Convert 300 dpi to 1024 dpi

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
mail2vguna
Posts: 20
Joined: 2015-06-04T07:52:46-07:00
Authentication code: 6789

Convert 300 dpi to 1024 dpi

Post by mail2vguna »

Hi

I am using IM 7.0.8 64 bit.
I have 250GB free space in D:\ drive
Used below command to set the path
set MAGICK_TEMPORARY_PATH=d:\temp
>magick.exe -units PixelsPerInch input.tif -resample 1024 output.tif
My system config
16GB RAM
256 SSD
1TB harddisk.

I have waiting for above 2 hours but still system showing processing.
input image details- width 8100, height 18000, file size 17.4MB

What is the best way/Fast to convert 300 dpi image to 1024 dpi. Is it possible or not?
Kindly help me to slove the issue.
Looking forward it.

Many Thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert 300 dpi to 1024 dpi

Post by snibgo »

"-resample" does two things. It changes the metadata, and it resizes the image which changes the number of pixels.

Your input image is large. At 8 bytes/pixel, 8100x18000 pixels need 1.16 GB. You are increasing this by a linear factor of 1024/300 = 3.413, which increases the area by a factor of 11.65, so the result needs 13.5 GB.

If your computer is doing nothing else, you might have enough memory for the input plus result. But I expect you don't, and IM is using d:\temp to store the pixel caches. (When the command runs, what does "dir c:\temp" say?)

You might try mpc as in input format. This is directly memory mapped, so should not need to use memory for the input:

Code: Select all

magick input.tif d:\temp\tmp.mpc

magick.exe -units PixelsPerInch d:\temp\tmp.mpc -resample 1024 output.tif
If that doesn't help, try "-limit memory 2mb -limit map 2mb" as the first options in the magick command. This forces all pixel caches to disk.
snibgo's IM pages: im.snibgo.com
mail2vguna
Posts: 20
Joined: 2015-06-04T07:52:46-07:00
Authentication code: 6789

Re: Convert 300 dpi to 1024 dpi

Post by mail2vguna »

Hi

Many Thanks

Below script works fine.

magick input.tif d:\temp\tmp.mpc
magick.exe -units PixelsPerInch d:\temp\tmp.mpc -resample 1024 output.tif

Does it work for output as 1920 dpi image. ? How much space need for that ?

Looking forward your reply.

Many Thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert 300 dpi to 1024 dpi

Post by snibgo »

1920 is nearly 2*1024, so the result needs twice as much in each direction, so 2*2 = 4 times as much memory.

For these large images, you could crop a portion of the input and resample that. Then (in another command) crop another portion and resample that. Keep going until all the input has been processed. Then append the results to each other. You would do this in a script.

I'm curious. What are these large images?
snibgo's IM pages: im.snibgo.com
mail2vguna
Posts: 20
Joined: 2015-06-04T07:52:46-07:00
Authentication code: 6789

Re: Convert 300 dpi to 1024 dpi

Post by mail2vguna »

Hi

Thanks. Will do the same.

Appreciated your help.
Post Reply