Fred's ImageMagick Scripts



 

 

PIXELIZE


Creates a pixelized or blocky effect in an image.

Download Script

last modified: May 30, 2008



USAGE: pixelize [-s size] infile outfile
USAGE: pixelize [-h or -help]

-s .... size ..... pixelization size; size>0; default=3

PURPOSE: To create a pixelized or blocky effect in an image.

DESCRIPTION: PIXELIZE creates a pixelized or blocky effect in an image where more pixelization (larger sizes) create larger blocky effects.

ARGUMENTS:

-s size ... SIZE is the pixelization (block) size. Values are greater than 0. The default is 3.

CAVEAT: No guarantee that this script will work on all platforms, nor that trapping of inconsistent parameters is complete and foolproof. Use At Your Own Risk.


EXAMPLES


Image Pixelization
http://www.cescg.org/CESCG97/boros/

Original

Arguments:
-s 3

Arguments:
-s 5

Arguments:
-s 7



What the script does is as follows:

  • Shrinks the image using -resize
  • Then exands it back using -scale

This is equivalent to the following IM commands.

  • w=`convert $infile -format "%[fx:w]" info:`
  • h=`convert $infile -format "%[fx:h]" info:`
  • minify=`convert xc: -format "%[fx:100/$size]" info:`
  • convert $infile -resize $minify% -scale ${w}x${h}! $outfile