Page 1 of 1

Convert 300 dpi to 1024 dpi

Posted: 2019-04-22T02:25:55-07:00
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.

Re: Convert 300 dpi to 1024 dpi

Posted: 2019-04-22T06:07:45-07:00
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.

Re: Convert 300 dpi to 1024 dpi

Posted: 2019-04-22T10:12:03-07:00
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.

Re: Convert 300 dpi to 1024 dpi

Posted: 2019-04-22T10:31:44-07:00
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?

Re: Convert 300 dpi to 1024 dpi

Posted: 2019-04-22T21:54:06-07:00
by mail2vguna
Hi

Thanks. Will do the same.

Appreciated your help.