Image resizing with LCD sub-pixel awareness (aka ClearType)
Posted: 2011-07-20T17:05:26-07:00
Hi!
I was testing how LCD sub-pixel awareness could enhance images when they are resampled to smaller sizes. This is like ClearType, but for photos. For that effect I used the following commands, you might find useful.
For normal resizing:
And considering the LCD as a silkscreen of RGB triplets with triple the horizontal resolution:
This results in ugly aliasing in some images, due to the "Point" sampling. There you should either use some horizontal blur, changing the first matrix into '0.25, 0.5, 0.25', or use Mitchell instead of Point. The results are less sharp, but more tempered so to say. The test image Rings1.jpg renders beautifully with a full Mitchell pipeline, and delivers a ugly rainbow otherwise.
Normal photos seem to work better with Point, or Point with a bit of horizontal blurring.
Here is a sub-pixel-resize example, with Point and no blurring ...
... and the same, with normal Mitchell resize.
The difference is subtle, but if you put each image in a browser tab and switch between them it should be apparent. The sub-pixel resampled shows more detail.
Of course, it only works on LCDs (or Plasmas) when 1 pixel in the image equals 1 pixel in the screen, that is, only at 1:1. Otherwise the sub-pixel sampled image is actually worse.
I was testing how LCD sub-pixel awareness could enhance images when they are resampled to smaller sizes. This is like ClearType, but for photos. For that effect I used the following commands, you might find useful.
For normal resizing:
Code: Select all
convert input.tif -depth 16 -gamma 0.5 -filter Mitchell -resize 960x640\! -gamma 2.0 -depth 8 -quality 100 -sampling-factor 1x1 output_yyy.jpg
Code: Select all
convert input.tif -define showkernel=0 -depth 16 -gamma 0.5 -filter Mitchell -resize 2880x640\! -morphology Convolve '3x1: 0.0, 1.0, 0.0' -channel Red -morphology Convolve '3x1: 0, 0, 1' -channel Green -morphology Convolve '3x1: 0, 1, 0' -channel Blue -morphology Convolve '3x1: 1, 0, 0' +channel -filter Point -resize 960x640\! -gamma 2.0 -depth 8 -quality 100 -sampling-factor 1x1 output_rgb.jpg
Normal photos seem to work better with Point, or Point with a bit of horizontal blurring.
Here is a sub-pixel-resize example, with Point and no blurring ...
... and the same, with normal Mitchell resize.
The difference is subtle, but if you put each image in a browser tab and switch between them it should be apparent. The sub-pixel resampled shows more detail.
Of course, it only works on LCDs (or Plasmas) when 1 pixel in the image equals 1 pixel in the screen, that is, only at 1:1. Otherwise the sub-pixel sampled image is actually worse.