Photo Map is now available to download on the App Store! It’s a brand new app that uses your photos to tell the story of the places you’ve visited. Your trip photos are found automatically and combined together on the map to create a beautiful composite of all the places you’ve been.
Features
- Photo Map automatically scans your Photo Library to find photos from each of your trips.
- Choose your favorite photo from each place you’ve visited.
- Export a customizable image of your map. (Perfect for sharing on social media!)
- Photo Map includes maps of the United States, World Countries, Europe, Canada, Australia, Asia, Africa, and South America.
- There’s hundreds of places to visit, and you’re just getting started. Find the inspiration you need to book your next adventure!
Origins
I had the original idea for Photo Map back in February 2017. I was inspired by a cool arts and crafts project I had seen where you cut out photos in the shape of the US State where they were taken, and then pin them up on a big wall map. I made the very first prototype of this idea at HackMerced 207, a hackathon deep in the heart of California’s Central Valley. Back then the app was just called “States”, because it only had a map for the US. That original prototype was way less polished, but the main idea was there.
On the Devpost submission at the end of the hackathon, I said that “I think it’s an idea that’s actually worth publishing. I might get around to it one day.” I had a few months of downtime after graduating from Georgia Tech in May, and it had been on my idea list for over two years, so I decided to finally revisit the idea.
Making Photo Map
Photo Map is the first new app I’ve made since I released AR Planes in February 2018. There’s still nothing more fun and rewarding than creating a whole product from scratch and actually getting it across the finish line. I had no shortage of hard problems and interesting challenges while working on Photo Map.
Choosing a Business Model
Most of my past app releases have been paid-up-front, but I wanted to try something different for Photo Map. I decided to launch Photo Map with a freemium business model. All users get the United States map for free. To unlock the other eight maps (including the World Map, Europe, Canada, etc.), users have to buy the “Explorer Pack” for $3. To make the value proposition a little better, I also bundled most of the Export Map customizations options into the Explorer Pack.
The problem with freemium apps is that you have to draw a line somewhere between the “free” features and “paid” features. If you give away too much for free, you harm your app’s revenue potential. If you lock too much behind a paywall, the user experience will be bad and you could come across as greedy.
There are lots of potential places where the line could be drawn in Photo Map, but I felt like the “Explorer Pack” is a good first try. It’s not perfect by any means — there’s no reason to buy the Explorer Pack if you’ve from the US and have never traveled abroad, and the free offering isn’t very useful if you’re from elsewhere and have never been to the US — but I think it’s a good starting point. I’m very interested to see how the launch goes!
Filtering with Computer Vision
It can sometimes be hard to find the perfect photo when digging through hundreds of photos taken in a given place. Early on, I added a filtering system so you can view photos from a specific year, or only see photos you’ve marked as “favorites” in the iOS Photos app. During the Beta process, somebody on Twitter suggested using Apple’s Vision framework to only show photos of people. I thought this suggestion was too cool to not try, but it turned out to be way harder than I expected!
The face detection API is reasonably easy to use, but it takes quite a while to run the algorithm on each of the hundreds of photos taken in any given place. The problem is that the user can change the active filters at any time, even while there’s a vision scan currently going on in the background. That means the app has to cancel the current in-progress scan and start a new one, possibly where the previous one left off. This was the first time I’ve ever really worked with cancellable, long-running background tasks, and there were a lot of multithreadding challenges that took some time to work through. The end result is pretty cool, and reasonably performant! (Although I have a feeling it’s gonna be my top source of weird and hard-to-reproduce crash reports 😅)
Photo Exporting
When I was working on the Photo Exporting feature, I wanted users to be able to export a copy of their map that was large enough that they could zoom in to even the smallest regions (like Washington DC on the US Map, or Luxembourg on the World Map) and still see high-resolution copies of their photos. DC and Luxembourg are pretty tiny, so the generated map image would have to be something like 30,0000 to 50,000 pixels wide. That’s really, really big. Almost just unreasonably large. But I still wanted it to be an option!
The problem with generating really, really large images is that iPhones simply don’t have enough RAM to hold the entire photo in memory at once. A 50,000 × 50,000 pixel image has 2.5 billion pixels and its in-memory bitmap image buffer would be 10 gigabytes large. Definitely not happening.
The workaround for this problem is to generate the image in multiple slices (where each slice on its own can fit within the RAM constraints), and then combine the slices into one file on-disk. Images have specific file formats, though, so it isn’t as simple as just cramming multiple PNG files into the same file.
The breakthrough I had was that, unlike PNG files, BMP files are completely uncompressed — they’re literally just “bitmap” files, which is the same image representation used when you render an image in-memory. This makes them really inefficient for large images, but it means that it’s possible to write a single BMP file in multiple slices. I set up a system that manually wrote out the BMP file header, rendered a slice of the image, blitz’d the pixels into the file, and then rendered more slices until the image was finished. It took a looong time to get right, but I got it to actually work!
Unfortunately, as cool as it is, a 3 gigabyte image isn’t really all that practical. I was hoping that Apple’s high-performance Image I/O framework would be able to convert the image from a BMP to a PNG (which would bring the file size down into more manageable territory). Unfortunately, Image I/O still tries to load the entire image into memory before doing the conversion. That’s the same barrier that made me try this on-disk-BMP nonsense in the first place, so it put a nail in the coffin on this experiment. If you have any ideas for a workaround, please get in touch! For now, a measly 13,000 × 13,000 pixel option will have to do. (That’s the largest image buffer an iPhone X can reliable work with. Photo Map uses smaller buffer sizes on older devices.)
iPad.... and Mac??
Photo Map fully supports iPad, and looks awesome on the larger screen size. The bottom tray moves over to the left, leaving plenty of space for you to see your map. That’s one feature that actually wasn’t too difficult, because I just used a great library called FloatingPanel. Good artists copy, great artists use existing open source implementations.
I’m also really interested in bringing Photo Map to the Mac this fall. Mac Catalyst looks really promising, and should make it a fairly easy process. I have a fair number of third-party libraries I would also have to port over, but I think it would be worth the effort! Maybe keep an eye out for a beta release in September 😉
One problem is that, the more platforms an app supports, the more likely people are to expect it to sync their data across all of their devices. Right now, Photo Map doesn’t offer any cloud syncing functionality. I feel like, for the Mac app experience to make sense, it would have to sync with the iPhone app. I conveniently have an unused iCloud Drive-based photo syncing system (that I built for Window but never shipped) lying around. So I’m thinking about it!
Launch 🚀
I’ve been working on Photo Map since April, and it’s been in beta since July. I’m super pumped to see how the launch goes! Only time will tell, but I’m optimistic. Download it and let me know what you think!!
Downloading Photo Map
Photo Map is now available to download on the App Store for iPhone and iPad!