ImageWorsener Demos Part 2

[Back to main page] [Previous page]

Demos of: enlarging the image, resampling filters, transparency, backgrounds, etc.

The original 20×20 image.

-h 90 -filter nearest

Nearest-neighbor resizing.

-h 90 -filter mix

Pixel mixing assumes that the original image is perfect, as opposed to a low-resolution approximation. It’s not good for enlarging images, unless you want a pixellated effect.

-h 90 -filter triangle

Linear interpolation. Fast, easy to program, and better than nothing.

-h 90 -filter hermite

Hermite is fast, and usually gives a clearer image than linear interpolation. It has good worst-case behavior, but it’s very blocky.

-h 90 -filter bspline

B-spline. Very blurry, but it makes even very jagged edges smooth, and has no halo or ringing artifacts.

-h 90 -filter gaussian

Gaussian. Blurry, but it’s about as good as a non-adaptive resampling filter can be and not have any halo artifacts.

-h 90 -filter quadratic

Quadratic filter. Designed to be a fast approximation of a gaussian filter.

-h 90 -filter mitchell

Mitchell is a balanced filter, with only slight blurring and haloing. A good general-purpose filter.

-h 90 -filter catrom

Catmull-Rom spline. Has no blurring, but does have a halo effect. IW’s default filter when enlarging.

-h 90 -filter lanczos

A 3-lobed Lanczos filter. This is the most popular of the “windowed sinc” filters. As with most such filters, it has no blurring, and minimal aliasing, but can have significant halo and ringing artifacts.

-h 90 -filter hanning

A type of windowed sinc filter.

-h 90 -filter blackman

A type of windowed sinc filter.

-h 90 -filterx mitchell -filtery mix

Mitchell filter in the horizontal dimension, and pixel mixing in the vertical dimension.

-h 90 -grayscale

Convert to grayscale+alpha.

-h 90 -bkgd f0f

Apply a solid background color.

-h 90 -bkgd 88f,0f0

Apply a checkerboard background.

-h 90 -bkgd 88f,0f0 -checkersize 5

A smaller checkerboard.

-h 90 -bkgd 88f,0f0 -checkersize 30 -checkerorigin 28,23

A larger checkerboard, shifted.

-h 90 -bkgd 88f,0f0 -cc 2 -dither f

Applying a background and dithering. Note that the background gets dithered.

-h 90 -bkgd 88f,0f0 -grayscale

Applying a background and converting to grayscale. Note that the background gets converted to grayscale.

-h 90 -filter catrom -blur 2.0

Blurred, mostly to make more partially-transparent pixels for the demos.

-h 90 -ccalpha 4 -filter catrom -blur 2.0

Restricted to 4 levels of transparency.

-h 90 -ccalpha 2 -ditheralpha f -filter catrom -blur 2.0

Binary transparency, with partial transparency simulated by dithering the alpha channel.

-h 90 -cc 2 -dither f -filter catrom -blur 2.0

Dither to an 8-color color cube, and to binary transparency. Note that the transparency and color dithering can interact in strange ways.

-h 90 -cccolor 2 -dithercolor f -filter catrom -blur 2.0

Dither to an 8-color color cube, but with a full alpha channel. This is silly, but included for completeness.

-h 90 -filter gaussian -blur 2 -bmptrns -cc 6 -ccgreen 7 -ccalpha 2 -dither f -edge t

Did you know that BMP (v3) images can have transparency? Well, sort of. When using RLE compression, pixels can be left undefined, and some web browsers will interpret undefined pixels as being transparent. IW has a -bmptrns option to take advantage of this. As of this writing, it works in Firefox and Chrome. Other browser will probably display the background of this image as either black or magenta.