• Please use real names.

    Greetings to all who have registered to OPF and those guests taking a look around. Please use real names. Registrations with fictitious names will not be processed. REAL NAMES ONLY will be processed

    Firstname Lastname

    Register

    We are a courteous and supportive community. No need to hide behind an alia. If you have a genuine need for privacy/secrecy then let me know!
  • Welcome to the new site. Here's a thread about the update where you can post your feedback, ask questions or spot those nasty bugs!

Helpful Hints/D.I.Y.: A free high quality resampling tool for ImageMagick users

Hi folks,

This post is a notification of the availability of a free tool for high quality image resampling (resizing). It is a works-in-progress project (hence the D.I.Y. title prefix), since the science behind it is also evolving, and there are a few inconveniences that yet need to be resolved.

The tool is a small Windows batch file, it can be downloaded here (link is updated to version 1.2.2). It depends on the availability of an already installed version of ImageMagick, an image processing toolkit that is usually operated from the command-line console. ImageMagick is also available for several other platforms, e.g. Mac OS and Unix/Linux, but the linked tool is specifically designed for Windows. However, it should be rather easy to translate it to another script dialect for other operating system script engines.

The Windows batch script file allows to drag an image onto the (icon of) the batch file in the file explorer or on the desktop. It can also be added to the Windows SendTo folder (e.g. 'C:\Users\YOURNAME\AppData\Roaming\Microsoft\Windows\SendTo' for Windows 7), which will then allow to right mouse-click on any image on your system and send it to the batchfile for processing.

The usage instructions are simple, just enter the required percentage (e.g. 50% will produce a copy at half the size of the original), or the maximum dimensions for an image (e.g. 800x800 will fit the longest dimension of your original image to 800 pixels, the smaller dimension will automatically scale proportionally, aspect ratio is maintained).

So what's so novel about it?

Well, image quality is usually negatively impacted by resizing (resampling) images. In addition to loss of sharpness, there are all sorts of artifacts that can be created, depending on image content and method of resizing. Aliasing artifacts of small repetitive features are very common on down-sampled images, e.g. for web publishing. Upsampling of images for larger print sizes may develop nasty halos around sharp edge transitions, and they will be easy to see because of the larger output size.

This is why there is ongoing research, as to which algorithms produce the best results. As a result of various on-line discussions (e.g. here, and here), a recent suggestion by a Canadian researcher (Nicolas Robidoux) has shown huge potential as a general approach that delivers high quality, low artifact, resized images. He asked me to try encoding his conceptual approach to facilitate further research into its optimization, which I did, and he has kindly allowed me to share the findings/scripted set of instructions that resulted.

Since the resized image quality is already so good, I decided to make a small batch script file for my own use, and share it with you for enjoyment.

There is still an issue that needs to be resolved though, and that has to do with the resulting file not having a color profile attached to it. So one is (untill I can find a simple solution) required to do that in a color-managed application that allows to assign the same profile as the original image had. Since many here use Photoshop, or similar applications that should only be an inconvenience, hopefully solved soon.
UPDATE, the colorprofile issue was fixed.

To be continued, image samples will follow.

Cheers,
Bart

P.S. The download link has be updated to point to the latest version (1.2.2)
 
Last edited:
*** UPDATE ***

I've found a solution for the embedding of the color profile, it seems ...

Here is an updated version (latest version is 1.2.2). The tool now copies the original profile that is embedded in the original image, and embeds that in the resized version. It also retains the original file type, so a JPEG remains a JPEG, and a TIF remains a TIF, it just has a different size, as indicated by the new file name, but now with the same profile as the original source.

The script (or rather ImageMagick) will produce warning messages if no profiles are embedded, but the conversion is still performed as intended, just without profile.

Cheers,
Bart
 
Last edited:

nicolas claris

OPF Co-founder/Administrator
Hi Bart
I'd love to give it a try… I'm sure Windows users will get a huge benefit of this script.
Congrats : D
 
Hi Bart
I'd love to give it a try… I'm sure Windows users will get a huge benefit of this script.
Congrats : D

Hi Nicolas,

It shouldn't take too many adjustments to translate the script to a Unix dialect that could run on Mac OS, provided one is bold enough to install ImageMagick as engine for the number crunching. Didn't you also have a Windows computer in the office, for Web development?

Anyway, I've updated the script (Version 1.2.2) with the latest insights that emerged form discussions elsewhere. That changes the behavior a little bit when viewed side by side it might be noticeable, but more importantly it reduces he risk of aliasing on very critical surfaces.

I also added the option to downsample with an even better method/quality, and do that with/without sharpening, e.g. for Web publishing. The embedded color profile of the original file is assigned to the result, so make sure that the profile is already what you ultimately want.

Cheers,
Bart
 
Last edited:

nicolas claris

OPF Co-founder/Administrator
Hi Bart
thanks for the reply.
Yes we do have a Windows computer running, but there's a man (Sébastien) working with it al the days round!
I do have imageMagick installed on my latest Mac:
mac-pro-step1-hero-2013

But have no clue on how to "translate" the script… :-(

It's good news that it can be used also for downsampling as I use more this than upsizing.
With the files from the 645D, I do have plenty room… : D

BTW Nowadays and without your script, the fastest and good way for down and up sizing can be done with Lightroom 5.5…
I get much better results than with Photoshop.
 
Hi folks,

The Windows Batch Script file has been updated to Version 1.2.2, with the main changes being: better down-sampling quality, more finely tunable and improved sharpening quality.

Cheers,
Bart
 
Last edited:
Here are a couple of examples that show the downsampling quality as can be achieved with the current version (V1.1.3) (Note: the script has been updated to V1.2.2 which can create a further improved quality):

The larger originals (longer download times due to size!) are here, and here.

7640_CO40_FM1-175pct_sRGB_V113+A150_800x800.jpg


0920_Tr_30pct_V113+A150_800x800.jpg

I've used a pretty strong sharpening amount of 150 (user adjustable), also to demonstrate that it doesn't totally ruin the image detail, it just adds more contrast to micro-detail, while trying to avoid visible halos.

Make sure to watch at the intended zoom factor of 100%, some browsers (automatically) enlarge the size based on the larger font setting of the desktop, even at a browser setting of 100%.

People who are used to shooting ship's rigging, like Nicolas, know how hard it is to avoid the jagged stair-stepped look of fine lines against a bright sky. This tool does it pretty well, IMHO.

Cheers,
Bart
 
Last edited:

Doug Kerr

Well-known member
Hi, Bart,

Make sure to watch at the intended zoom factor of 100%, some browsers (automatically) enlarge the size based on the larger font setting of the desktop, even at a browser setting of 100%.

Indeed, Firefox does so, something I discovered when recently working with certain monitor test images.

I note the following on my Windows 7 system, using Firefox V31:

I have the "display resolution" set to 120 px/in ("125% of the default").

If I have the Firefox zoom set to two steps of "zoom out" from "reset", and "Only zoom text" unchecked, then I get pixel-for-pixel rendering. (So on my system, that browser zoom setting must be 80.0% zoom.)

I cannot at all be certain that this holds in every situation. I will do some more research on that.

There are settings in about:config that influence the "normal" zoom ratio. I need to learn more about them.

Best regards,

Doug
 
Hi, Bart,



Indeed, Firefox does so, something I discovered when recently working with certain monitor test images.

I don't know yet how to avert this in a practical way.

Hi Doug,

My Win7 machine uses a 125% setting for the display of desktop icons and such (due to it's higher resolution display), and that triggers my Firefox browser to 125% image size viewing at a 100% zoom setting. If I want to see the true size, I need to zoom in Firefox to 80%, but that of course also reduces the size of text (<CTRL>- and <CTRL>+ also zoom out and in).

It's not as it should be, displaying a larger font size should leave the images alone.

Cheers,
Bart
 

Doug Kerr

Well-known member
Hi, Bart,

Hi Doug,

My Win7 machine uses a 125% setting for the display of desktop icons and such (due to it's higher resolution display), and that triggers my Firefox browser to 125% image size viewing at a 100% zoom setting. If I want to see the true size, I need to zoom in Firefox to 80%, but that of course also reduces the size of text (<CTRL>- and <CTRL>+ also zoom out and in).

It's not as it should be, displaying a larger font size should leave the images alone.

Indeed.

"Is that right?"

"Maybe not, but it's so."

How can one set the zoomage in Firefox to a certain value numerically (that is, other then with Zoom out/Zoom in (<Ctrl>-/<Ctrl>+)?

Best regards,

Doug
 
Top