Page 1 of 1

Upscaling

Posted: 2012-07-17T10:31:48-07:00
by steve___
I have images similar to this: http://imgur.com/189v5 Their widths are between 1000px and 1200px. I'd like to upscale them to a width of 1280px. In my first attempt I tried:

$ convert -resize 1280 a.jpg b.jpg

The picture was slightly blurry. I googled around and came across '-unsharp -30':

$ convert -resize 1280 -unsharp -30 a.jpg b.jpg

This seems to work well. I was wondering if this was the best way. I'd like to keep the colours the same and the picture as sharp as the original.

Thanks,
-steve

Re: Upscaling

Posted: 2012-07-17T11:43:20-07:00
by fmw42
proper syntax, which may or may not make any change is to put the input image right after convert, then the options/commands, then the output.

unsharp radiusxsigma should really be done by radius=0 and sigma. That way radius defaults to about 3xsigma, which allows the gaussian used within to roll off to near zero; otherwise, you may be getting a truncated gaussian.

For resizing you can choose some other filter, such as Catrom, Lagrangian or various Lanczos options and control the sharpness via a -define for blur. That may also help sharpening to magnified image.

see
http://www.imagemagick.org/Usage/basics/#cmdline
http://www.imagemagick.org/script/comma ... php#resize
http://www.imagemagick.org/script/comma ... p#geometry
http://www.imagemagick.org/script/comma ... s.php#blur
http://www.imagemagick.org/Usage/resize/
http://www.imagemagick.org/Usage/distorts/#resize

Note there has been some futher discussion about resizing to enlarge at
viewtopic.php?f=22&t=21435
viewtopic.php?f=22&t=21415&start=30

Re: Upscaling

Posted: 2012-07-17T16:20:00-07:00
by anthony
You are doing what is known as USM resize, a photoshop resize method.
See IM examples, Resize with Sharpening
http://www.imagemagick.org/Usage/resize/#resize_unsharp