V
V
Valeriu Vodnicear2019-04-25 17:53:45
PHP
Valeriu Vodnicear, 2019-04-25 17:53:45

How to change the number of image pixels (resolution)?

There is a folder with 3000 pictures in PNG.
They have Pixels/Inch: 72 and dimensions 354px by 130px
At the output, you need to get the same pictures with Pixels/Inch= 300, save the sizes.
The question is how to do this operation for at least one picture?
And is it possible to do this in PHP?
PNG - optional, you can get any other format as an output.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Valeriu Vodnicear, 2019-04-26
@vodnicear

exec('convert -units PixelsPerInch originalImage -resample 300 outputIamge');

M
Maxim Timofeev, 2019-04-25
@webinar

Available => Available
there is a lot of software for that
Of course, there are a lot of libraries for working with images, for example:
https://php.net/manual/ru/function.imageresolution.php
https://www.php.net/manual/ru/imagick.setresolution.php

K
Kim_Soal, 2019-04-25
@Kim_Soal

doesn't an increase in Pixels/Inch entail an increase in the number of pixels?
Pixels/Inch is needed for the print. In the normal format, this is just an enlargement of the picture.
In other words, count how many pixels at your Pixels / Inch should be and increase the pictures, of course, with a loss of quality

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question