How do I convert jpg image to tiff with 300DPI and reduce noise to 100%?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ahmedtamseer
Posts: 5
Joined: 2018-10-12T05:46:40-07:00
Authentication code: 1152

How do I convert jpg image to tiff with 300DPI and reduce noise to 100%?

Post by ahmedtamseer »

I have been working on an image from last 25 days with zero output. So I came here in search of an answer.

I have a jpg image of 7MB. I upload it in Photoshop and changed the width to 96 Inch, Resolution for 300 pixels/inch, checked resample option and selected Preserve Details 2.0 and reduce noise to 100%. It gave me a 1.5 GB image as output.

Now I tried the same steps in image magic

gm conver -scale 768 -units PixelsPerInch -density 300x300 -resample 300x300 -noise 100% image.jpg -resize 768 image.tiff

Above command gave output in KBs. I need help.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How do I convert jpg image to tiff with 300DPI and reduce noise to 100%?

Post by snibgo »

"gm" is GraphicsMagick, not ImageMagick. They are different systems.

ImageMagick ("IM") mostly works in pixels, not inches. What are your input dimensions in pixels? What dimensions do you want for the output?
snibgo's IM pages: im.snibgo.com
ahmedtamseer
Posts: 5
Joined: 2018-10-12T05:46:40-07:00
Authentication code: 1152

Re: How do I convert jpg image to tiff with 300DPI and reduce noise to 100%?

Post by ahmedtamseer »

Sorry, My bad.

Thank you for your info on pixels. I found a way to tackle it. inches * DPI = pixels; ie 96 * 300 = 28800

I have an image, let say of 5059x3360 in pixels. I actually want to resize it to user entered dimension. let us consider it be 2400 (pixels) width by maintaining the aspect ratio of the image.

Is there any way to covert it using "convert" of ImageMagick.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How do I convert jpg image to tiff with 300DPI and reduce noise to 100%?

Post by snibgo »

Code: Select all

convert in.png -resize 2400x out.png
Notice the order: read the image, process it, and write it.

The "-resize" includes the width but not the height, so it will make the width 2400 while keeping the aspect ratio.

See http://www.imagemagick.org/script/comma ... php#resize
snibgo's IM pages: im.snibgo.com
ahmedtamseer
Posts: 5
Joined: 2018-10-12T05:46:40-07:00
Authentication code: 1152

Re: How do I convert jpg image to tiff with 300DPI and reduce noise to 100%?

Post by ahmedtamseer »

Will "widthx" work? Because I can not see it here in the link below.

https://www.imagemagick.org/script/comm ... p#geometry

Anyways I removed gm and ran the original command. I got approximate outside. I still wonder why it didn't work with the combination of graphicMagic.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do I convert jpg image to tiff with 300DPI and reduce noise to 100%?

Post by fmw42 »

Why do you need to resample the image (-resize or -scale)? Why not just change the density so that it prints to the desired print size.

You would only need to resize if you desire a smaller file size.

Code: Select all

convert image -units pixelsperinch -density XX result
Where you compute the density give the pixels dimensions so that the pixel dimension/density = print size

or

dimension/printsize = density
ahmedtamseer
Posts: 5
Joined: 2018-10-12T05:46:40-07:00
Authentication code: 1152

Re: How do I convert jpg image to tiff with 300DPI and reduce noise to 100%?

Post by ahmedtamseer »

I want to convert an image to 300DPI so I used -resample. When I used -resample without using -density it threw an error, saying (somewhat like) "Image does not contain resolution".

If a run below code
convert input.jpeg -units pixels-grinch -density 300x300 output.tiff

I got below error
convert: unrecognized units type `pixels-grinch' @ error/convert.c/ConvertImageCommand/3147.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do I convert jpg image to tiff with 300DPI and reduce noise to 100%?

Post by fmw42 »

It is properly -units pixelsperinch. Sorry my automatic spell corrector change what I typed and I did not notice it.
Post Reply