I am using PHP and the .dll in a windows server at the moment, and I have large 80mb .tiff images that I have managed to scale down to around 500x500 jpegs. They still take up around 600kb of disk space however, which is not suitable for the web. The images are at 300 dpi and I need them to be reduced in quality and dpi to around 50-60kb and 72 dpi. The problem is that I have not found a function in the API that can do these things. Does it only work from the command prompt?
I have tried a lot of functions that seem to be almost exactly the same:
Code: Select all
MagickResampleImage($resource, 500, 280, MW_GaussianFilter, 1);
MagickResizeImage($resource, 500, 280, MW_GaussianFilter, 1);
MagickSampleImage($resource, 500, 280); <---Best quality
MagickScaleImage($resource, 500, 280);
MagickSetImageResolution($resource, 500, 280); <-- no effect?
MagickSetResolution($resource, 500, 280); <-- no effect?
I am aware that this only stretches the images and does not actually change the quality, in fact even if I set the x and y to 50x50, the image file still takes up the same amount of disk space. Please help me reduce the disk size and quality to something similar to what "Save for Web" does in Photoshop. Thanks!