rmagick-temp / rmagick

An interface to the ImageMagick and GraphicsMagick image processing libraries.
http://rmagick.rubyforge.org/
MIT License
790 stars 102 forks source link

Resolution management #46

Open daniel2d2art opened 12 years ago

daniel2d2art commented 12 years ago

Hi

I've next resource:

file: 300dpi.jpg dimensions: 1782px x 1181px size: 304539 bytes resolution: 300dpi x 300dpi

when I use:

image.resize_to_fill!(460, 345)

I get: file: 300dpi_conversion_1.jpg dimensions: 460px × 345px size: 21718 bytes resolution: 300dpi x 300dpi Result: Ok expected

Now I want to try reduce the resolution, I use:

image.density="72x72"
image.resize_to_fill!(460, 345)

I get: file: 300dpi_conversion_2.jpg dimensions: 460px × 345px size: 21718 bytes resolution: 72dpi x 72dpi Result: resolutions seems change but size its the same at 300x300

No I try to reduze adding resample too, I use:

image.resample(72.0, 72.0)
image.density="72x72"
image.resize_to_fill!(460, 345)

I get: file: 300dpi_conversion_3.jpg dimensions: 460px × 345px size: 21718 bytes resolution: 72dpi x 72dpi Result: resolutions seems the same 72x72 as above test, but size its the same at 300x300 too

??? How change resolutions works???, I don't get clareance about it on documentation, it's working ok? How can I upload a image file (JPG, GIF, PNG) optional (TIFF, BMP), and transform they change resolution and resize?

Thanks