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 » 2018-10-12T06:06:31-07:00

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: 10958
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 » 2018-10-12T06:29:03-07:00

"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 » 2018-10-12T23:12:32-07:00

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: 10958
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 » 2018-10-13T03:38:04-07:00

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 » 2018-10-15T22:25:23-07:00

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: 24135
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 » 2018-10-15T23:22:04-07:00

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 » 2018-10-15T23:48:11-07:00

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: 24135
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 » 2018-10-16T09:24:09-07:00

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

Post Reply