I m writing a program that reads a directory and then makes for each jpg file a thumbnail and a resized picture in 640x480. Everything should be only for use on the computer.
I m pretty new and now I was searching too long without getting any useful information.
Ok, so I read the image and then
Code: Select all
MagickThumbnailImage(magick_wand,w,h);
But then come the problems:
1. resizing vs. resampling
I read a lot on the Internet about it but I m still confused. Please correct me if I misunderstood anything: With Resizing some pixel are deleted/duplicates so that the new picture got the new pixel size. I'm not sure what Resampling really does. According to http://www.retouchpro.com/forums/glossa ... ample.html the pixel size doesnt change. However, if I do resampling with a picture to get 72dpi (I found that this should be the best resolution for monitors) my picture changes its pixel size. I had a picture that was 2253x1690 and so
Code: Select all
MagickResampleImage(magick_wand, 72, 72, CatromFilter,1.0);
EDIT: Ok so now I know a bit more. My picture has a resolution of 180x180 and even if I resample this into 72 with
Code: Select all
MagickResampleImage(magick_wand, 72, 72, CatromFilter,1.0);
Code: Select all
MagickResampleImage(magick_wand, 180, 180, CatromFilter,1.0);
All I know is that I have different pictures with different resolutions and/or different pixel size. I want that they are after this conversion 640x480. So should I use resample or resize?
2. If I set the compression level nothing changes.
EDIT: I tested it out and when I set the compression quality down both resampling and resizing change.
What is the difference between MagickSetImageCompressionQuality and MagickSetImageCompression?
My pix shouldnt be bigger than 50KB (some became 70KB some 190KB). How can I ensure that my image gets smaller than 50KB. I mean I would start with the best quality and then write this file, check the filesize and then so this as long as it is bigger. Is that a reasonable way?
3.Which filter?
I found a nice pagehttp://www.dylanbeattie.net/magick/filters/result.html that shows the different filters. I couldnt find which is the bes for my purpose, though. I tried several different and couldnt see any difference. I m sitting on a laptop and so just a little movement with my head makes a difference. I think that Catrom, Lanczos and Sinc are the best. What are your experiences?