1

I was looking through the StackExchange Photography section before I posted my question. I want to make a triptych of a single imagine essentially cutting it into three equal parts. I don't have Photoshop so that's not an option for me, are there any good sites, apps etc for making a triptych like this.

(If there is a question I missed on this site about this please direct me to it and I will close this Thread.)

2

You do not have Ps, but you can use Gimp, or Krita, or Paint.net, or FireAlpaca, or MediBang Pro, or a bunch of free raster applications.

You can also import the images on Open Office Draw. Or use Scribus to crop the images or even Inkscape.

Inclusive you can crop an image using IrfanView.

Or as this is a Photo forum, you can be creative and take the 3 images directly, framing your scene correctly.

Do not limit yourself.

1

ImageMagick (Photo-SE tag: ) is excellent for this, for both slicing the image into strips, as well as re-combining (if you're making a single "matted" triptych image).

Slicing

Assuming your single image file is named input.jpg, the following command will create 3 equal width (within +/- 1 pixel) tall narrow slices slice_1.jpg ... slice_3.jpg from it:

convert input.jpg: -crop 3x1@  +repage  +adjoin  slice_%d.jpg

See also ImageMagick's Examples: Cropping into roughly Equally Sized Divisions page for copious examples of use of the convert command.

Combining

There multiple ways to combine images using ImageMagick. For your purposes, probably the easiest is the montage command:

montage  slice_*.jpg  -tile 3x1  -geometry +10+10  triptych.jpg

This lays out the images (assuming they are the JPGs output from the convert slice command above) into a three-wide tile with a 10x10 px border between and around them. See ImageMagick's Montage Tile Layout Controls page for more examples.

Another method, below, comes from the accepted answer to the Stack Overflow question, How do I make the images equidistant using imagemagick/montage?,

If you are just making a triptych, you may get on better with convert +append to lay out images in a row with spacers. So, if your images are slice_1.jpg, slice_2.jpg and slice_3.jpg:

convert -background black \
  slice_1.jpg xc:black[10x] slice_2.jpg xc:black[10x] slice_3.jpg +append \
  -bordercolor black -border 10 triptych.jpg

The xc:black[10] are just the two spacers that you can set the width of explicitly. Then the three images with spacers are set in a horizontal row, using +append. Finally, at the end, I put a border around the whole lot with -border.

A note regarding image quality (JPEG)

The examples above assumed using a JPEG as the source image. Because JPEG is a lossy image format, manipulations such as slicing, combining (especially with very contrast regions such as adding matte borders between triptych images), etc., will likely result in generational quality loss (that is, every file manipulation).

If your source image is a JPEG, one solution would be to first export it with highest quality settings to a lossless format, such as TIFF or PNG. Then all ImageMagick operations using the PNG would remaining lossless.

Alternately, if your source image came from a RAW source, export the RAW to PNG or TIFF first, and avoid the JPEG path entirely, or at least until the very final output export if necessary. In general, I find it useful to think of JPEG as an output-only format, and not use it as an intermediate stage format that will have further transformations done on it. That's not always an option, but I adhere to it when I can.

  • Does ImageMagick do a lossless crop of the JPEG? – mattdm May 28 at 12:40
  • @mattdm There's a lot of subtleties buried in your question. Firstly, cropping pixels other than multiples of 8 in the original will not take advantage of the 8 px JPEG blocks, causing suboptimal recompression. Any normal JPEG comp. other than "none" will therefore cause some loss. But still, I'm not sure chopping on 8 px boundaries will prevent loss (I think that's more of a file size optimization than a quality loss optimization). Fundamentally, any writing of JPEGs at less than 100% quality is lossless, since lossy compression occurs. The solution is either 100% qual, or maybe PNG. – scottbb May 28 at 13:04
  • 100% quality JPEG also recompresses (although maybe not enough to be a problem). With today's pixel resolutions, rounding the crop to 8 pixel boundaries instead of 1 pixel should not make too much of a visual difference. – mattdm May 28 at 13:07
  • @mattdm Hmm... I'll have to read up on IM to see if the convert -crop command can be persuaded to crop in even thirds, but only on 8px multiples. Somehow I don't think so. – scottbb May 28 at 13:18
  • @scottb, chopping at x8 prevents loss only if 1) using ordinary editors/apps you are using the exact same settings and the exact same software or 2) you are using software that doesn't recompute anything and picks the 8-blocks data from the initial picture (Photoline did this I think)(this can also support 90° rotations and flips). In practice, even for 1) you need a couple of cycles for the round-off errors to settle (this is used in image forensics). – xenoid May 28 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy