PHP GD

Hi i want to generate card by php GD library. I generate perfect image for me but it have only 72 dpi. Is any way to generate with 300 dpi image.
LVL 1
umaximAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Ray PaseurConnect With a Mentor Commented:
OK, let's look at it this way.  Let's say you want a card that is 3 inches wide, and you want to print it at 300DPI.  Make the image 900 pixels wide.  Set up your printer to print at 300 DPI. Et voila.
0
 
Lukasz ChmielewskiCommented:
0
 
AriMcCommented:
The DPI in a jpg (I assume that's the format you're using) is just a setting in the headers, but you could try this:

http://www.develobert.info/2008/11/php-jpegjpg-dpi-function.html

0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
umaximAuthor Commented:
I use png
0
 
AriMcCommented:
Ok, what is the reason of wanting to have different DPI? Pixels are just pixels regardless of the format they are stored in.

0
 
Ray PaseurCommented:
Do not worry about the DPI.  Just create the PNG image of the pixel dimensions you want to use.  Typically computer display densities are 72 or 96 DPI.  Print densities are usually 150 to 300 DPI.  If you want to put an image on the screen and also print the image, you need to use two different image files.

You might skip this step if the images are very small - just use CSS to express the display width and height.  But you probably don't want to interject a 3 MB image into a 300x200 picture window.

When it becomes time to print the image, your client can set the pixel density to a level that is suitable for the printer.  

0
 
umaximAuthor Commented:
This is a problem i do not show image to people i just save it to print on server.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.