D0Gmatist / smart-lencioni-image-resizer

Automatically exported from code.google.com/p/smart-lencioni-image-resizer
GNU General Public License v3.0
0 stars 0 forks source link

Poor quality resized image #12

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Resize an image
2.
3.

What is the expected output? What do you see instead?
Clear resize. Ends up quite blurry.

What version of the product are you using? On what operating system?
r92, Linux

Please provide any additional information below.

Generally I am using SLIR to make thumbnails of large-ish images, and so
this is not normally a problem, but small changes in size to the original
can sometimes give poor results.

For example:

Original:
http://ian.umces.edu/images/look_inside/ian_report_235_53.jpg

Resized:
http://ian.umces.edu/imageresizer/h690/images/look_inside/ian_report_235_53.jpg

The height of the original is 693, so it is only being changed by 3px, but
it really is quite blurry.

Another example - this time a PNG:
http://ian.umces.edu/images/ecocheck_report_240_thumb.png

vs

http://ian.umces.edu/imageresizer/h100/images/ecocheck_report_240_thumb.png

In this case it is only a 1px change.

To be honest, even using imagemagick I sometimes struggle to get good
looking results, but I do think they can better than GD. I know you mention
somewhere that you are thinking of providing IM support. Can I request that
you support the Imagick extension, rather than via exec calls?

Original issue reported on code.google.com by adrianbj...@gmail.com on 26 Feb 2010 at 11:27

GoogleCodeExporter commented 8 years ago
Not sure if this would help or not, but just a thought - I wonder if ceil() is 
part
of the problem. Perhaps it would be better to create a custom rounding function 
that
rounds down if less than .5 and rounds up if .5 or greater. That way the 
dimension
that is being calculated relative to the dimension that is being set.

For example, if someone sets w100 and the resulting height calculation is 
234.01,
ceil() would round that up to 235, and hence stretching the image to almost an 
entire
pixel. But if you had a custom rounding function, it would round down to 234 and
therefore it would shrink it by only .01 of a pixel.

Just an idea!

Original comment by adrianbj...@gmail.com on 3 Mar 2010 at 3:46

GoogleCodeExporter commented 8 years ago
I noticed that you just switched from ceil to round, but I am not sure if that 
will
be any better. In my comment above I was suggesting that it should round up or 
down
depending on which it is closer to. Because round always goes down, I don't see 
this
will help. Please let me know if I am missing the point though :)

Original comment by adrianbj...@gmail.com on 3 Mar 2010 at 8:15

GoogleCodeExporter commented 8 years ago
Hi

I'm using SLIR on my site and having problem with the quality.

Here is the original image
http://chwisgi.com/wp-content/uploads/hanyu-1986-22-years-part-des-anges-14579.j
pg

Here is the same image at the same size and q=100
http://chwisgi.com/slir/?w=400&h=534&q=100&i=/wp-content/uploads/hanyu-1986-22-y
ears-part-des-anges-14579.jpg

Here is the image in a smaller size
http://chwisgi.com/slir/?w=150&h=250&q=100&i=/wp-content/uploads/hanyu-1986-22-y
ears-part-des-anges-14579.jpg

With both images there is visible artifacts in the white area, is there a way 
to remove this?

/Jens

Original comment by jens.we...@antrop.se on 15 Aug 2011 at 8:28