Photoshop Script for Resizing All Photos for Instagram

I like to post my park photography on my Instagram, and Instagram only allows certain crop ratios. As of right now (March 2020) the ratios and their optimal sizes are:

  • Portrait: 1080 x 1350 (4:5)
  • Landscape: 1080 x 566 (1.91:1)
  • Square: 1080 x 1080 (1:1)

I mostly use the 4:5 (I like the landscape in principle, but on a phone app it’s easily overlooked.) But sometimes a photo looks bad cropped at 4:5, in which case I might crop it however I like, then add a little “padding” to each side to make it 4:5. I usually do this with 4:6 photos, but any portrait size could use this trick.

Example of a 1.91:1 landscape photo on an Instagram screen
Landscape (1.91:1) – Easily overlooked on Instagram!
Example of a 4:5 portrait photo on an Instagram screen
Portrait (4:5)
Example of a photo on Instagram padded to fit the 4:5 ratio
Padded portrait (4:5) – Notice the white strips on both sides

But what if you have several photos in multiple ratios (say, a bunch of images you just exported from Lightroom) and want all of them to be optimized from Instagram at once? A Photoshop script can do the trick!

Read below if you don’t know how to install a Photoshop script (it’s very easy!) Otherwise you can download the .jsx file, or copy the code from here:

while (documents.length > 0) {

	var docRef = activeDocument;
	var docName = activeDocument.name;
	var layerRef = docRef.activeLayer;
	var currentWidth = docRef.width;
	var currentHeight = docRef.height;
	var imgRatio = currentWidth / currentHeight;

	
	if (imgRatio < 1.92 && imgRatio > 1.9) { //1.91:1 ratio
		docRef.resizeImage ("1080 pixels", "566 pixels", 72);
	} else if (imgRatio == 0.8) { //4:5 ratio
		docRef.resizeImage ("1080 pixels", "1350 pixels", 72);
	} else if (imgRatio == 1.0) {
		docRef.resizeImage ("1080 pixels", "1080 pixels", 72);
	} else {
		if (currentHeight > currentWidth) {
			var paddedWidth = currentHeight * 0.8 ;
			docRef.resizeCanvas (paddedWidth, currentHeight, AnchorPosition.MIDDLECENTER);
			docRef.resizeImage ("1080 pixels", "1350 pixels", 72);
		} else {
			docRef.resizeImage ("1080 pixels", undefined, 72);
			alert ("The image " + docName + " is too tall for the 1.91:1 ratio. It was resized to 1080 pixels wide, but will need to be cropped when uploaded to Instagram.");
		}
	}

	function saveJPEG( docRef, saveFile, qty ) {
		var saveOptions = new JPEGSaveOptions( );
		saveOptions.embedColorProfile = true;
		saveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
		saveOptions.matte = MatteType.NONE;
		saveOptions.quality = qty; 
		docRef.saveAs( saveFile, saveOptions, true );
	}
	
	docName =  docName.match(/(.*)(\.[^\.]+)/) ? docName = docName.match(/(.*)(\.[^\.]+)/):docName = [docName, docName];
	var suffix = '-insta';
	var saveName = new File(decodeURI(docRef.path)+'/'+docName[1]+suffix+'.jpg');

	saveJPEG( app.activeDocument, saveName, 12 );	
	docRef.close(SaveOptions.DONOTSAVECHANGES);
}

Photoshop Scripts for Beginners

If you ever need to do something repetitive in Photoshop, a script can likely do it for you. It’s similar to the basic automation under Windows > Actions, but it can make more complex decisions based on input (such as the current ratio of your image).

To use my script (or any script, Google “free Photoshop scripts” and go nuts), first download it, then put it in your Scripts directory (mine is at C:\Program Files\Adobe\Adobe Photoshop CC 2019\Presets\Scripts). Restart Photoshop.

My script requires all the photos you want to run it on to already be open in Photoshop. After you’ve done that look for “Instagram Sizing” under File > Scripts and select it.

Screenshot of Photoshop showing a script selected under File > Scripts

Boom, it’s done! The photos will be saved in their original folder with the “-insta” suffix on their filenames.

What the “Instagram Sizing” Script Does

The script I wrote looks at each open document in Photoshop and resizes it to the optimal Instagram size. If it’s already 4:5 or 1.91:1 ratio it only changes the pixel size to 1080 pixels wide; if it’s 4:6 or some other portrait size it first adds padding to make it 4:5. All images are then saved at 72 dpi with the suffix “-insta” added to the filename, and closed.

If it’s a weird landscape size it resizes it to 1080 pixels wide, and an alert pops up to remind me that I’m going to have to crop it again in Instagram (I didn’t want it to crop automatically since the script would have no idea what would look the most visually pleasing.) This case rarely comes up, but I may eventually change it to instead add padding to the top/bottom to make it 4:5 as well.

Please note that this script was written to work on jpgs that I’d just exported out of Lightroom. I’m not a programmer, I just know a little bit of Javascript and wanted to see if I could make something for my particular needs. I did, and it was fun, but I’ve no doubt someone out there could write a broader and more efficient version of this script.

Uploading to Instagram from Your Computer

You may have noticed that, when you go to your Instagram page on your desktop computer, there doesn’t seem to be any way to upload photos (without third-party software, anyway). But there is a way!

Using the Chrome browser, go to your Instagram page and right-click on the background and select Inspect. A frame full of code should show up on the right side of the window; ignore this and look for the little screen resize button near the top.

Screenshot showing the "toggle device" button in Chrome's inspect mode

Toggle this button to switch between desktop Instagram and mobile screen Instagram–the mobile version will have the little upload photo button you’re used to seeing on your phone. You may have to refresh the page first to make the upload button show up.

It’s not perfect–your filters are available, but edit doesn’t seem to do anything. And once you’ve uploaded a photo you can’t go back and change it (you still can on your phone). Still, I’ve found it a lot more convenient than transferring my photos to my phone and then trying to write captions and hashtags without a real keyboard.

Happy Instagramming!

Twists and Turns at Bonham State Park

Twists and Turns at Bonham State Park

My October visit to Bonham State Park was bittersweet; on the one hand, it rained hard the first day and my hiking boots tore up and my rain-jacket turned out to be only weather resistant and the trails were weird, man.

But on the other hand, I had a nice time with a great group of campers from a local Meetup. My camping meals are usually snacky and–well, let’s say utilitarian (I eat a lot of surplus MREs)–but on this trip I was blessed with an abundance of real, hot food from many generous people, along with good conversation and a cheery atmosphere. It really helped, as the rest of my Bonham experience was kind of a wet mess.

I went for a hike soon after setting up camp; it was raining and my boots tore up, as mentioned, and filled with water. The trail–the Gnarly Root trail, –was covered, in most places, with the stickiest grey mud I’ve ever encountered. It packed into the tread of my shoes like cement; it formed a crust all around my boots that quickly built up, heavier and heavier (I’m pretty sure this is what finally ripped off the soles.) Scraping the mud off was futile–the only time I saw it easily release was when I was walking and great big gobs of the stuff would detach from my boot and coat the back of my legs.

None of the signs I saw referenced the Gnarly Root trail by name–they all said things like “M-3” and “A-5” and had little bicycle symbols. My trail map did not use these symbols, although it didn’t become a problem till the next day when I went for a hike on the Bois d’Arc trail.

It had stopped raining by then, although I made the mistake of walking through a patch of wet grass and instantly resoaking the insides of my boots. I then proceeded to get lost–really lost!–on the bizarre hairball of trails that make up the Bois d’Arc. The M-whatever signs were no help, and there were no other markers. Just when I think I’d pieced together the only possible spot I could be based on the map and nearny landmarks, the trail would unexpectedly fork. There are also only two CCC points of interest marked on the trail map in that area, but I found at least five different things that they might have been referring to.

So I was lost, but not scary lost. The entire Bois d’Arc trail is only 2.7 miles, and maybe half of that is the tangled-up bit where I got stuck. I eventually got out by following voices and found a couple of other hikers by the road who said they had also gotten turned around. Other than being completely bewildering it was a fine trail, with only a few steep parts and a lot of lovely lush, green moss in the trees. If my feet had been dry I would have enjoyed getting a little lost out there.

The Lake Loop and Armadillo trails were much more straightforward; the former was flat with cute little bridges here and there and led to a few nice spots by the shore, and the latter was gently sloped and often covered with crushed bricks.

Although I was cold and wet for most of it, my trip to Bonham State Park definitely had some high points. I saw several spiderwebs slung across the trails, all with the same kind of orb-weaver hanging on them, and I was eventually able to take a really decent photo of one–my favorite shot of the trip. In terms of composition I feel like my photography took a step forward at Bonham.

I also enjoyed the truly delicious labors of a Dutch oven presentation, held by some of the park rangers outside in the main day use area. Bonham seems like a really great park for day users, with its small, tidy lake and an abundance of covered picnic tables.

I’d like to return to Bonham State Park, with better gear or at least better weather. The facilities were clean, the park rangers were great and I choose to view the trails–now that I’m not standing out in the middle of them in wet socks–as a fun challenge. I give Bonham 3 out of 5 stars, and will bump up the rating if somebody will go out there and set out a couple of usable trail signs for us directionally-challenged hikers. No regrets! The Texas State Park system, once again, provided me a weekend of healthy physical activity, great memories and interesting photo opportunities.

Something is wrong.
Instagram token error.
Load More
Everything’s Heavy at Longhorn Cavern

Everything’s Heavy at Longhorn Cavern

The last stop in my June 2019 four-state-parks-and-a-state-natural-area trip was Longhorn Cavern. There’s no camping at this park, but the enormous Inks Lake is just up the road.

It was starting to rain as I arrived. I signed up for a cave tour and then hung around a bit outside and explored some of the trails–they’re all easy and very short (the longest is just over half a mile). It was nice to be able to walk around in the woods while waiting for the tour to start, rather than just hanging out at the gift shop, and I enjoyed poking around some of the historic CCC structures and trying to take their photos in the increasingly wet weather.

I returned to the visitor center and waited on the cozy back porch with my fellow tourists for our guide to arrive; the rain picked up and started coming down in earnest. The nice thing about a cave, of course, is that it’s all underground–I slipped and slid a few times just outside the entrance, but once inside the bad weather was confined to a few holes in the ceiling.

Longhorn Cavern is a treasure–big and comfortable and with excellent lighting design that really shows off all those weird, alien-landscape cave structures. In some places the walls looked rough and crystal-like, in other places creamy and smooth. The tour guide had a lot of great information, both geological and historical–for instance, one of the cavernous rooms was used as a dance hall and concert venue in the ’20s, and food and other supplies were lowered through openings in the top. The tour was about a mile long, every ambling twist and turn bringing another interesting texture or ancient structure into view.

There wasn’t much wildlife, just the occasional hibernating bat. The guide informed us that these were tricolored bats (named so, I half-remember, because they were brown, dark brown and brownish gray.)

I have one little regret: in order to keep up with the tour and out of everyone else’s way I didn’t use my tripod for any photos and just cranked the ISO up as high as it could go. It was a great low-light photography learning experience, but I do hope one day to photograph a cave at leisure. It was a little heartbreaking to be literally surrounded by stunning, abstract patterns of light and shadow and texture and not being able to take a few thousand slow and careful photos.

There were a couple of kids on our tour and they seemed to enjoy the tour as much as me, albeit in a more expressive way. Most of the parts of the cave you explore are open and airy; the floor is usually paved with cement. There was a part where all the adults had to hunch over for a little bit.

Our tour guide mentioned the weekly Wild Cave Tour, which is where you pay to crawl through the mud and squeeze through the tiny spaces of the unfinished parts of the cavern. I later learned that one of my friends had gone through this. According to her, “We wore hard hats and crawled around in some spaces. Even went through an underground lake. We had to crawl through it so you got totally soaked.”

She added, “Definitely not the average cave tour. Totally worth the time.”

Expect to spend about an hour and a half on the regular tour; you can bring a picnic lunch or get food at the visitor center. I arrived early and booked the first tour of the day and there was no line, however their website recommends you book your tour ahead of time. I’m sure they get a lot of Inks Lake traffic.

Longhorn Cavern is a five out of five, and any trip to Inks Lake should include this tour.

Something is wrong.
Instagram token error.
Load More
Inks Lake: Bigger and Better

Inks Lake: Bigger and Better

When I decide to camp at a Texas State Park I have a couple of different approaches–either I obsess over every little detail, poring over reviews and photos and trail maps and trying to pick out the perfect campsite and all the must-see hikes before making my reservation, or I go in completely blind and just hope for the best.

I went into Inks Lake State Park completely blind. I only made my reservation because I intended to visit Longhorn Cavern State Park on the way back from South Llano River, and needed somewhere to stay for the night (Longhorn doesn’t allow camping). Inks Lake was just up the road.

There’s something magical about just showing up at a new park and plunging in, discovering all its charms organically–like unwrapping a gift. And Inks Lake was the gift that kept on giving.

The first thing I noticed was the sheer size of the place. Inks Lake State Park has somewhere around 200 campsites (and another 20-something cabins), and it felt, as I got lost circling through overlapping camping loops, as if every single one of them was occupied for the weekend. It felt chaotic at first, but after a while I could see that it was just another summer day for the park and its busy rangers, and I got the hang of the loops. There was litter, yes–not surprising on a weekend in summer–but the bathhouse in my camping area was immaculate (and plenty large).

After getting settled in a couple of times (I accidentally pitched my hammock at a neighbor’s site) I went exploring along the lake till I found the Devil’s Waterhole, a busy swimming area cradled by tall bluffs of stone dotted with clusters of people sitting and looking at the water or jumping in it.

I climbed to the top of a bluff and was delighted to see one of my favorite outdoor environments: a whole bunch of rocks and water. A creek wound through a field of stone–everything from pebbles to boulders–and pockets of rich green grass and mounds of shrubs. It was a wet day, completely overcast and not-exactly-but-yeah-kinda raining; the greens in the grass and shrubs were vibrant; the rocks, however, were slick as hell.

I managed to slip and slide down to the river without falling on my butt more than once. I poked along the river and tried to capture, in photographic form, the bliss I feel when I’m in a place like that. There were fewer people here, and I met a cool dog that was much more sure-footed than I. I could have stayed there for hours, but I was dying to see what else Inks Lake had in store for me.

The Trails at Inks Lake State Park

I tackled the Devil’s Backbone nature trail first, a narrow path about a mile long that explored woods and prairies and rocks–mostly in a flat way, but fairly steep in a few places. There were some lovely cliff-top views of the lake, and at the end of the trail was the nicest bird blind I’ve ever seen. I’m not even sure “blind” is the right word for it–it was more like a cabin, with multiple rows of wooden seating facing large glass windows on one side. Beyond the windows lay a garden full of bird feeders and bird-friendly plants and the birds that loved them; I sat for a while and played with my long lens.

I later walked the Valley Spring Creek trail. It was an easy, wooded trail that I briefly lost when it came to a creek running beneath a road. I hung out under the bridge awhile, snapping pictures of bugs and angry cliff swallows, then found my trail on the other side of the creek and kept going. The sun started to come out.

After that I did the first part of the Lake trail on my way to another hike on the map. The Lake trail was well-worn and an easy walk for the most part, occasionally vanishing completely where the ground had turned to stone slab and the trail signs turned into painted green dots on the slab.

The Pecan Flats trail did not start off as anything special–a few nice boulders, some yellow wildflowers, pretty but similar to what I’d already seen. It ducked into the woods for a little while, where there were a lot of cedar trees and a lot of cedar mulch around them–the smell was amazing!–but then the trail stepped back into the sunlight and into some of the most stunning natural beauty Texas has to offer.

The sky was blue, with only a few puffs of cloud scattered around it, and that morning’s drizzle had been replaced by steady wind. The sun was out in full force, and it was hot–even the wind was hot. But as I walked into all that open beauty I got actual chills up and down my arms.

Imagine a million golden wildflowers; now imagine a million more, bowing in rippling soft waves like the ocean. They carpet the hills and valleys like shag, broken up only by clumps of boulders and naked black trees and cacti and my thin, rambling trail.

The landscape was bathed in wind and sunlight, open and wild and unspoiled–only when I got to higher points on the trail could I see civilization in the distance. The blackened trees (I assume from a recent controlled burn) stood in beautiful stark contrast against the waves of golden yellow. I was in love.

The whole rest of trail was that way, like walking through a living postcard. I saw one other person out there–twice, because I looped around and did part of the trail again–but was otherwise alone with nature.

I hit two smaller trails on my way back (The Upper and Lower Fisherman’s trails). They were perfectly nice, with several good lake vistas (and fishing spots) but at this point I was exhausted. I left the Woodland trail for another trip. I’m dying to know if it’s as nice as Pecan Flats.

Inks Lake State Park is now one of my favorite Texas State Parks. And it has a certain quality–something about the size, I guess, and the way it positively hums with activity around the lake–that makes me want to revisit with a bunch of friends and stay multiple nights. Solo camping is great, but wild and wonderful Inks Lake begs to be shared with everyone.

Something is wrong.
Instagram token error.
Load More