views:

259

answers:

1

I have a 72 dpi tiff that I'm trying to upsize to a 300 dpi tiff. I can do it from within image programs such as Gimp or even OS X built in preview. For some reason I can't seem to figure out how to do it in netbpm. I tried the following command line:

tifftopnm < sample1.tif | pamditherbw -threshold -value 0.5 | pamscale 4.2 | pamtopnm | pnmtotiff > sample1.out.tif

This produces a image that is 4.2 times the size of my original image but the output is still 72 dpi. How do I increase the actual pixels/inch of the image using netbpm, or is it even possible? I've tried pamenlarge too, which gives the same result. I also used the -xresolution and -yresolution parameters for pnmtotiff and it seems to just change the tag of the resolution, but doesn't actually enlarge the image.

A: 

Well I couldn't quite figure this out with netpbm so I switched over to ImageMagick and it is rather simple. What I was trying to achieve above in image magick:

convert sample1.tif -resample 300 -threshold 50% sample1.out.tif

Ish