ppi / dpi

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ppi / dpi

Sandu Crasteti
Hello!



Please, somebody help me, if possible, with an algorithm (or a pointer to
such an algorithm) that allows saving an image in a (png, for example) file,
with a pre-set resolution (pixels per inch), to have the possibility to
visualize (process) a set of patterns (shapes) having the same dimensions in
inches (millimeters), which can be represented using different numbers of
pixels - like scanning the same image at different dpi resolutions.



Best regards,



Sandu Crasteti
Reply | Threaded
Open this post in threaded view
|

Re: ppi / dpi

ch-2
For tasks like this, I usually use the NetPBM utilities.  They may
already be installed with your linux distribution.

pngtoppm input.png | pamscale 2.5 | ppmtopng > output.png
pngtoppm input.png | pamenlarge 2 | ppmtopng > output2.png
pngtoppm input.png | pamstretch 2 | ppmtopng > output3.png
pngtoppm input.png | pamstretch-gen 2.5 | ppmtopng > output4.png

Change the value of '2' for some other scale factor.  pamenlarge and
pamstretch can only use integers, while pamscale and pamstretch-gen can
use real numbers.

On Wed, 2006-02-22 at 12:15 +0200, Sandu Crasteti wrote:

> Hello!
>
>
>
> Please, somebody help me, if possible, with an algorithm (or a pointer to
> such an algorithm) that allows saving an image in a (png, for example) file,
> with a pre-set resolution (pixels per inch), to have the possibility to
> visualize (process) a set of patterns (shapes) having the same dimensions in
> inches (millimeters), which can be represented using different numbers of
> pixels - like scanning the same image at different dpi resolutions.
>
>
>
> Best regards,
>
>
>
> Sandu Crasteti
Reply | Threaded
Open this post in threaded view
|

Re: ppi / dpi

jiho
On 22 Feb 2006, at 11:13, CH wrote:
>>
[...]

>> Please, somebody help me, if possible, with an algorithm (or a  
>> pointer to
>> such an algorithm) that allows saving an image in a (png, for  
>> example) file,
>> with a pre-set resolution (pixels per inch), to have the  
>> possibility to
>> visualize (process) a set of patterns (shapes) having the same  
>> dimensions in
>> inches (millimeters), which can be represented using different  
>> numbers of
>> pixels - like scanning the same image at different dpi resolutions.

I'm not sure to fully understand what you mean but ImageMagick is  
very capable in this kind of things (distributed with most linux and  
available for Mac via fink and probably also for windows).

JiHO
---
   Windows, c'est un peu comme le beaujolais nouveau :
a chaque nouvelle cuvee on sait que ce sera degueulasse,
     mais on en prend quand meme par masochisme.
---
http://jo.irisson.free.fr/