GreenKoopa wrote:I have read all of the usage examples for
resize and
photos (and as much of filters as I could absorb). I am looking for a good default or starting point.
-resize vs -distort
Is there any advantage to -resize other than simplicity and possibly speed? -distort is more flexible and I'm usually cropping when resizing. When rotating and resizing, I assume it must better to resample in one pass.
Well they do use two very different methods. resize using very fast 2 pass method, distort using a single pass but much slower method. And yes doing the resample in a single pass is better, but not always easy to achieve.
Resize as two pass method stores intermedate data in an image, and as such values can lose quality (unless you use HDRI version of IM.
However distort is much more general, It can not only rsize, but it can also distort (rotate, shear, skew, etc). Scaling (what resize is really doing) is generally the smallest, simplest aspect of a distort.
Also with distort you can specify a 'viewport', something which is actually required, though IM has some 'default' viewports (depending on if -distort or +distort is used). As such distort will let you crop at the same time and thus avoid doing calculations for areas that you would junk anyway.
-filter
It seems -resize defaults to Lanczos and -distort defaults to Robidoux. Is one of these better for down-sampling photographs? My cropped digital photos are 2 to 16 megapixels.
- Use case 1: screen resolution (0.2-0.6 MP, 15-45% scale)
- Use case 2: print resolution (60-110% scale, most frequently with a 1-3° rotate)
- Use case 3: binning (use -scale, which is -filter box -resize)
I use Q16 (because it seems to be the default).
The two filters were picked as 'reasonable defaults' Robidoux is essentially a slightly sharper Lancoz, and turns out to be almost exactly equivalent to the other default 'Mitchell', which is actually another default for resize!
Really they are all just good compromises for general use.
Code: Select all
[b]Sharpening[/b]
I have no experience with sharpening (sad but true). Is it better to do this with the resize filter, -unsharp, or both?
True sharpening is often down as part of the filter. But people like controls, and so often like to do an extra unsharp, (which has thresholding) afetrwards. Photoshop makes that a default!
-colorspace and -gamma
I have been resizing without leaving sRGB. Apparently this has been my biggest mistake. RGB seems best, unless someone knows when Lab is better.
There has been debate as to whether doing resize in sRGB is actually better! Yes it makes 'averaged colors' mathematically correct (a black-white hash will become a correct perfect gray) But it seems the cost is in increase in halo effects.
Basically use what works for you. I myself don't really bother, but then I am not a photographer, and typical can see the artifacts using linear-RGB generates more that the color distortions I get from no colorspace change.
Some people actually swear by using LAB or LUV for resize/distorts.
Hopefuly it's okay to use Anthony's photo
beijing.jpg to demonstrate what I currently do:
Code: Select all
convert beijing.jpg -auto-orient -strip ^
-crop 1200x1800+334+500 ^
beijing_print_4x6.jpg
convert beijing.jpg -auto-orient -strip -quality 90 ^
-set option:distort:viewport 1200x1600+334+610 -set option:distort:scale %%[fx:576/1600] -distort SRT 0 ^
beijing_576.jpg
convert beijing.jpg -auto-orient -strip -quality 90 ^
-set option:distort:viewport 1200x1600+335+616 -set option:distort:scale %%[fx:576/1600] -distort SRT -2.2 ^
beijing_r_576.jpg
No problem. It is a photo I personally took. and find it a useful 'test photo'.
Especially for Tilt Shift Effects as it is a nice 'landscale'. with little in the way of vertical walls.