Image Resizer ?>

Image Resizer

I have many pictures that I would like to use as backgrounds. But thoses pictures were a bit small (640×480 usually) and my screen is at 1024×768. I think that I am not the only one in this case. So I will needed to resize thoses pictures.

I look at what xv do but it was really ugly. So I try to write my own resizer.

resize_image is a little utility to resize images. You can read JPEG, GIF, Targa (TGA), PBM, PGM and PPM images. You will need JPEG library to use it. You can only output in PPM or JPEG formats. It is written in C so if you want to compile you’ll needed a C compiler (only tested with gcc under Linux i386).

You have nine algorithmes to resize.

  • The first is the simplest technique. We always take the nearest dot we have. It give the feeling of big dot (xv like). Use option —nearest.
  • The second is a bilinear interpolation. Fast and near what I saw in gimp. But this method give blurred images. So I decided to try something else. Use option —bilinear.
  • The third algorithme do a 2D DCT on dots near the one we have to find. Then use the 2 dimensions curves to find out what is the best value. It is really slow (1024×768 image take 15 minutes to render) but the picture is less blurred. I have also image border effect (not welcome) but I keept them because they are not bad looking. Use option —dct.
  • The fourth algorithme use Catmull-Rom BSpline to interpolate. This is a slow and not very good. Algorithme need to be improve. Use option —bspline.
  • Two special ’TV mode style’ are provided. Those mode only works to double the size of the images. Use option —tv or —tv2.
  • The most present pixel algorithme repeat the most present pixel value in an area to add missing pixels. It can look good depending on the original image. This algorithme only works to double the image size. Use option —most or —most2 (two variations).
  • Another algorithme is provided to downsize an image. It perform an antialiasing. All other algorithme are only good to increase the images’ size. Use option —down.
  • The last algorithme is also to downsize an image. It’s different from the previous one and give less blur. Use option —down_rought.

Version 0.7. Correct a bug when Loading GIF images renamed as JPEG. Added -jq to setting quality when creating jpeg files. All update thanks to Krzysztof Guc <krzysiek@venturi.com.pl>.

Download source : resize_image-0.7.tar.gz 93308 bytes.

Download RPM for Fedora Core 2 : resize_image-0.7-1.i386.rpm 38896 bytes.

Download Source RPM : resize_image-0.7-1.src.rpm 95800 bytes.

Version 0.6. Correct a bug when saving image in PPM. Red color was shift from one pixel. Thanks to Marc Patoureaux for this patch.

Download source : resize_image-0.6.tar.gz 87249 bytes.

Download RPM for RedHat 7.3 (should work good for Mandrake 8.2) : resize_image-0.6-1.i386.rpm 38700 bytes.

Download Source RPM : resize_image-0.6-1.src.rpm 89716 bytes.

Version 0.5. Added a new algorithme to downsize an image. This algo is less blur than the previous one. You can use it with -dr option. Also change the tar.gz source file to allow simple RPM recompilation with : rpm -ta resize_image-0.5.tar.gz

Download source : resize_image-0.5.tar.gz 87249 bytes.

Download RPM for Mandrake 8.2 : resize_image-0.5-1.i686.rpm 39032 bytes.

Download Source RPM : resize_image-0.5-1.src.rpm 89672 bytes.

Version 0.4. Change the command line syntax. Added parameters -w and -h to give the result image dimensions. Now only one of theses parameters is needed (width or height). If only one is given, the other is calculated using the original image ratio.

Download source : resize_image-10.06.2002.tar.gz 86747 bytes.

Download RPM for Mandrake 8.1 : resize_image-0.4-1.i686.rpm 85888 bytes.

Download Source RPM : resize_image-0.4-1.src.rpm 89218 bytes.

Version 0.3. Added the possibility to take read image from stdin (standard input) and write to stdout (standard output) if the file type is specified and only for JPEG images.

Download source : resize_image-12.01.2002.tar.gz 86492 bytes.

Download RPM for Mandrake 8.0 : resize_image-0.3-1.i686.rpm 85462 bytes.

Download Source RPM : resize_image-0.3-1.src.rpm 88731 bytes.

Version 0.2 :

Download source : resize_image-30.09.2001.tar.gz 87397 bytes.

Download RPM for Mandrake 8.0 : resize_image-0.2-1.i686.rpm 82499 bytes.

Download Source RPM : resize_image-0.2-1.src.rpm 89634 bytes.

Version 0.1 :

Download old version : resize_image-21.03.2000.tar.gz 38624 bytes.

I have put some pictures here so that you can see what it give and/or use them as backgrounds. None of thoses images are mine and I don’t know their authors so don’t ask me what you can do with them. If you are the authors and are not happy to see your images here or want me to give some details on thoses images contact me : daniel(at)golac.fr.

Size in backet is the orignal size (or cut of original images). Dimension ended by DCT are for DCT resized images, dimension ended by Bi are for bilinear interpolations and Nor are for nearest interpolations. All resized images are around 500 KBytes.

Join files:

Les commentaires sont clos.