V
V
Valeriu Vodnicear2019-04-18 15:10:42
PHP
Valeriu Vodnicear, 2019-04-18 15:10:42

How to generate png with 300 dots in php?

In php, images are generated by default with 72 points.
And for printing, the standard is at least 300 points.
So, you also need to generate pictures with 300 points from php. How to do it?
Or is it possible to somehow compress pictures that have 72 points into a smaller size in pixels, but so that the number of points is greater?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
ThunderCat, 2019-04-18
@ThunderCat

DPI is a conditional parameter that is calculated in relation to material dimensions, but there are only two real parameters of a digital image - width and height in points. Perverted things a la pixel ratio are not taken into account. Therefore, take the width / height of the final product in cm, convert to inches and multiply by 300, get the number of dots on the corresponding side.

R
rPman, 2019-04-18
@rPman

If you send something for printing, then practice shows that if you do not have pdf, then there are no guarantees that the sizes will match, unfortunately these are the realities.
In practice, you can guarantee something if the client's software (and even device) matches your test benches, then use at least html or even ms word (that's where the crap is).
If you want to try printing an image specifically, use GD's setImageResolution method. It seems in jpeg this data can be saved.
ps image can consist of at least 1 pixel, but by setting the resolution to 1dpi, for example, then this pixel on paper will (should) become a 1-inch square.

G
GreatRash, 2019-04-18
@GreatRash

https://www.php.net/manual/ru/function.imageresolu...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question