You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact us.
Geek ChatAsk computer questions or just engage in general geek talk on here
yeah don't use GD, use Imagemagik. GD always resamples to 72 pixels per inch and makes things grainy. Where imagemagik will keep resolution and the comments included with the image. you will have to make system or shellexec calls to use it "on-the-fly" but you will be much happier with the results.
cool, it works quite nicely and is very full-featured. It is also well documented. one thing I love is that it will preserve aspect ratio so if you wanted to convert all thumbnails to 50 pixels high you can specify [CODE]/usr/local/bin/convert <in filename> -resize 50x <out filename>[/CODE]
All right, imagemagick is working great for resizing large image (1200x1600 to 800x600 for example), however when I take a large image and try to make a thumbnail out of it, I again have a problem with it being grainy.
For example, look at this thumbnail it generated:
But it generated other larger resized-images from the same source image with perfect quality.
Don't use thumbnail, it does some other things to make them smaller, it may be messing with you, try just using resize. If that works then add -strip. you should also be able to omit the quality statement and default to the picture quality.
[PHP]function resizeImage($imagePath, $imageName, $destImageName, $max_x, $max_y){
exec("convert " . $imagePath . $imageName . " -resize " . $max_x . "x" . $max_y . " " . $imagePath . $destImageName);
}[/PHP]
for those following this thread, the issue was a problem changing from jpg to gif and the conversion process messing up the colors, it is now using jpg and looks great, still larger than it needs to be but it's on the right track.
From there, I run this command:
[code]convert wallpapers/47-1280x1024-f430spider05.jpg -thumbnail 1024x768 wallpapers/test.jpg[/code]
However the generated image: http://www.car-wallpapers.net/wallpapers/test.jpg
Is 960x768, when the original image was 1280x768, so it would resize fine without stretching, as it appears to be trying to prevent (thus binding to my Y value, and resizing X to whatever it wants).