![]() |
unsightly resized image quality - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: unsightly resized image quality (/showthread.php?tid=5663) |
unsightly resized image quality - El Forum - 01-30-2008 [eluser]sawatdee[/eluser] I am resizing some images after they are uploaded using GD. When I use the CI image manipulation class, the quality of the resized image is horrible. Here is the code I use to do it. Code: $imageConfig ['image_library'] = 'GD'; But when I use the following code to do the same thing, the quality is great. As far as I know, these functions use GD as well. Have I missed a setting or something? Note: $imageData comes from the uploaded image. Code: $resized = imagecreatetruecolor ($widthNew, $heightNew); unsightly resized image quality - El Forum - 01-30-2008 [eluser]diez[/eluser] if your server supports GD2, then edit your $imageConfig ['image_library'] variable from 'GD' to 'GD2' example: $imageConfig ['image_library'] = 'GD2'; that will properly resize your images. i had the same problem until i changed my 'image_library' variable from 'GD' to 'GD2' remember you got to calculate your own aspect ratio on your own. so once you figure out your proper height and width this should do a much better job resizing. hope this helps! unsightly resized image quality - El Forum - 01-30-2008 [eluser]sawatdee[/eluser] I use a web host, so I am limited to what they have installed, GD only. I am using the following code to calculate my new width and height, and it works great when I don't use the CI image library. As far as I know, both algorithms use GD. I haven't examined the CI source code closely, but if others have had the same problem and GD works when I don't use the library, then I wonder if there could be a small bug in the library somewhere. Wish I had time to look into it. Code: $widthRatio = $widthMax / $imageData ['image_width']; unsightly resized image quality - El Forum - 01-30-2008 [eluser]elvix[/eluser] i had the same problem -- but i switched to the imagemagick library and the issue went away. unsightly resized image quality - El Forum - 06-02-2009 [eluser]graf[/eluser] has anyone found a resolution for this issue? I'm currently maintaining a site that utilizes GD Image & FFMPEG, i'm unable to upgrade to GD2 due to certain constraints. While building a new section/module for the site i ran into this issue: Images after resizing loos over half of their color saturation... Any suggestions? Thanks! |