Page 1 of 1

Add white border to existing large image

Posted: 2019-03-29T02:58:49-07:00
by mail2vguna
Hi

I am using IM version ImageMagick-6.8.5-3 on windows.

source image test.tif (1920 dpi, width - 51840 , height - 115200, bit depth - 1, image size - 711.MB)

set MAGICK_TEMPORARY_PATH=d:\temp - 50 GB available in d: drive

i am trying to add border like 8000 pixels to left, right , top and bottom to test,tif image.

i am using the following code to add the border

convert.exe -border 8000x8000 test.tif output.tif

i am getting error while using below code
TIFFWriteDirectoryTagData: IO error writing tag data.
convert.exe: Incompatible type for "RichTIFFIPTC"; tag ignored. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/824.
convert.exe: unable to extend cache `test.tif': No space left on device @ error/cache.c/OpenPixelCache/3753.
convert.exe: IO error writing tag data. `TIFFWriteDirectoryTagData' @ error/tiff.c/TIFFErrors/562.

But its taking long time to add border. Still need more space in d:\ drive? what is the approximate free space need in d: drive? How can i make it fast?

Kindly do the needful. Many Thanks

Re: Add white border to existing large image

Posted: 2019-03-29T03:16:02-07:00
by snibgo
IM v6, assuming Q16 non-HDRI, needs 8 bytes per pixel to read the image, and the same amount to create and populate the new image with the border.

51840 * 115200 * 8 = 48 GB. So you don't have enough memory or disk space.

Re: Add white border to existing large image

Posted: 2019-03-29T03:18:47-07:00
by mail2vguna
Hi
Thanks for quick response.
So what is the solution for that? Should i use latest IM version? 500 GB free space.
How can i make it fast? it is possible to do the less than 2 minutes (add border).

Many thanks

Re: Add white border to existing large image

Posted: 2019-03-29T03:22:59-07:00
by snibgo
How much free space do you have, 50GB or 500GB? 50GB isn't enough.

IM Q8 will use half the memory.

Re: Add white border to existing large image

Posted: 2019-03-29T03:50:20-07:00
by mail2vguna
Hi

My external hard drive has 500GB free space, shall i use that?

Approximately how much time it will take to complete the process(add 8000 pixel in each side to large image (based on above input image)).

Many Thanks.

Re: Add white border to existing large image

Posted: 2019-03-29T04:03:34-07:00
by mail2vguna
Hi

I have downloaded ImageMagick-7.0.8-Q8 64 bit for windows.
set MAGICK_TEMPORARY_PATH=d:\temp
magick.exe -border 8000x8000 d:\1920.tif output.tif

magick.exe: no images found for operation `-border' at CLI arg 1 @ error/operation.c/CLIOption/5262.

What is the operation in 7.0.8 version instead of border?

Looking forward your reply.

Re: Add white border to existing large image

Posted: 2019-03-29T09:21:16-07:00
by fmw42
Read the input first, then add the border. Why such a large border? You might also want to specify the bordercolor.

Code: Select all

magick.exe d:\1920.tif -border 8000x8000  output.tif

Re: Add white border to existing large image

Posted: 2019-03-29T09:50:49-07:00
by mail2vguna
Hi

Thanks for your response

Tried following script.

magick.exe d:\1920.tif -border 8000x8000 output.tif

magick.exe: Incompatible type for "RichTIFFIPTC"; tag ignored. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/995.
magick.exe: memory allocation failed `d:\1920.tif' @ error/tiff.c/ReadTIFFImage/1800.
magick.exe: no images found for operation `-border' at CLI arg 2 @ error/operation.c/CLIOption/5262.

in d: drive i have 50GB free space.

Re: Add white border to existing large image

Posted: 2019-03-29T10:05:29-07:00
by mail2vguna
HI

Tried with 355GB free space external hard drive using following script

set MAGICK_TEMPORARY_PATH=e:\im - 355GB free space in e: drive

D:\Program Files\ImageMagick-7.0.8-Q8>magick.exe d:\1920.tif -border 8000x8000 output.tif
magick.exe: Incompatible type for "RichTIFFIPTC"; tag ignored. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/995.
magick.exe: memory allocation failed `d:\1920.tif' @ error/tiff.c/ReadTIFFImage/1800.
magick.exe: no images found for operation `-border' at CLI arg 2 @ error/operation.c/CLIOption/5262.

Any solution to fix the issue ?

Looking forward your reply. Anything wrong with my IM script?

Help me.

Re: Add white border to existing large image

Posted: 2019-03-29T11:05:32-07:00
by fmw42
You may be running out of RAM. Also it appears you did not rearrange your command as I suggested. IM 7 requires precise order. You must read the input image before adding a border.

Code: Select all

magick.exe -quiet d:\1920.tif -border 8000x8000  output.tif
Note that warnings do not hurt. They imply that your TIF file has meta tags that IM does not understand. But if you only have warnings and no errors then your output will be created. You can avoid the warnings by adding -quiet to your command as above.

You have two errors and one warning. The first error

memory allocation failed `d:\1920.tif'

Implies either you did not rearrange the command line or you do not have enough RAM.

Re: Add white border to existing large image

Posted: 2019-03-29T12:12:37-07:00
by snibgo
How much physical memory do you have? Perhaps reading the file takes all your memory, and there is none left for the border operation. Try "-limit memory 1GB -limit map 1GB" at the start of the command.