in reply to How to create images with 300dpi?
If you create an image 500x500 and then view it on a 1280x1024 15" screen, then the image will be 5 3/16 inches per side which equates to 96dpi.
However, if you display that same image on a smartphone with a 800x480 4.3 inch screen, then (assuming that the browser doesn't do any scaling) the image will be 2.1 inches per side; which translates to 237 dpi.
Same image, different dpi depending upon what it is displayed or printed on.
In order to view a 500x500 image at 300 dpi, it would have to be displayed or printed on a device capable of 300 pixels per inch -- eg. a printer -- and would show up as 1.67 inches per side.
The first problem appears to be that you are creating 8-bit color images instead of 24-bit color images. That's your fault not the modules.
If you do my $gd = GD::Image->new( 500, 500 ); then you'll get a palettised 8-bit color image.
If you do my $gd = GD::Image->new( 500, 500, 1 ); then you'll get a 24-bit (true)color image.
You'll probably need to make some other changes to your current code to achieve best results, but as you haven't posted it, we can't advise you further.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to create images with 300dpi?
by aky (Acolyte) on May 26, 2012 at 09:50 UTC | |
by BrowserUk (Patriarch) on May 26, 2012 at 12:06 UTC | |
by aky (Acolyte) on May 26, 2012 at 12:47 UTC | |
|
Re^2: How to create images with 300dpi?
by Anonymous Monk on May 27, 2012 at 08:35 UTC | |
by BrowserUk (Patriarch) on May 27, 2012 at 10:47 UTC |