For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > February 2005 > Changing DPI of the image.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Changing DPI of the image.
Hello

2005-02-22, 3:56 am

PHP creates images (like PNG) with 72 DPI. How can I create an image with
300 DPI?

Thank you.


Michael Vilain

2005-02-22, 8:55 am

In article <PQzSd.3199$873.2950@newsread3.news.pas.earthlink.net>,
"Hello" <no-emai@sorry.com> wrote:

> PHP creates images (like PNG) with 72 DPI. How can I create an image with
> 300 DPI?
>
> Thank you.


buy photoshop and create the original image with that resolution.

--
DeeDee, don't press that button! DeeDee! NO! Dee...



Hello

2005-02-22, 8:55 am

This is NOT just for one file. My prog generates a picture file which I need
to print. However, with 72DPI it is way too blocky, I need 300DPI. The
conversion has to be with PHP.

"Michael Vilain" <vilain@spamcop.net> wrote in message
news:vilain-433A9A.00324022022005@comcast.dca.giganews.com...
> In article <PQzSd.3199$873.2950@newsread3.news.pas.earthlink.net>,
> "Hello" <no-emai@sorry.com> wrote:
>
>
> buy photoshop and create the original image with that resolution.
>
> --
> DeeDee, don't press that button! DeeDee! NO! Dee...
>
>
>



Dave Patton

2005-02-22, 3:57 pm

"Hello" <no-emai@sorry.com> wrote in
news:PQzSd.3199$873.2950@newsread3.news.pas.earthlink.net:

> PHP creates images (like PNG) with 72 DPI. How can I create an image
> with 300 DPI?


Sounds like you're using the PHP Image functions, which
use the GD library.
Use ImageMagick instead(or it might work if you recompile
your GD library and define a higher DPI value).

--
Dave Patton
Canadian Coordinator, Degree Confluence Project
http://www.confluence.org/
My website: http://members.shaw.ca/davepatton/
Philip Ronan

2005-02-22, 3:57 pm

Dave Patton wrote:

> "Hello" <no-emai@sorry.com> wrote in
> news:PQzSd.3199$873.2950@newsread3.news.pas.earthlink.net:
>
>
> Sounds like you're using the PHP Image functions, which
> use the GD library.
> Use ImageMagick instead(or it might work if you recompile
> your GD library and define a higher DPI value).


Alternatively you could turn on output buffering, capture the PNG source in
a string, and change the binary values containing the DPI information. The
PNG file format isn't all that complicated, so it shouldn't be too difficult
to fix.

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com