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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lukasz ChmielewskiCommented:
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:

umaximAuthor Commented:
I use png
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Ok, what is the reason of wanting to have different DPI? Pixels are just pixels regardless of the format they are stored in.

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.  

umaximAuthor Commented:
This is a problem i do not show image to people i just save it to print on server.
Ray PaseurCommented:
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.