Page 1 of 1
converting image to multiple a4's with glue edge ?
Posted: 2014-08-24T12:30:39-07:00
by Rye
So. I'm currently trying to print out a huge picture over multiple images and then glue them together.
There already exists software for such task, such as PosteRazor and such.
However they all have one huge flaw:
They require using a Scissor and have sometimes inconsistencies applying the glue line
if a image like this:
could be turned into multiple A4's with glue line like this:

(orange is the glue line
i'd be totally satisifed, however I think short of imgmagick I cannot imagine this to work.
So the rundown is:
- Take any image
- cut it to multiple A4 images while adding ~2cm of empty glue line like pictured above
(Optimal would be if it took every image given to it and automagically cut and slice it to the perfect amount of required A4's.
(In order to keep 100% image size)
Re: converting image to multiple a4's with glue edge ?
Posted: 2014-08-24T13:46:03-07:00
by fmw42
I am confused. Why do you want to cut them into separate A4 size images and then add the glue (padding) and then put them back into one big image? Do I misunderstand?
Don't you just want to cut the big image into separate A4 size images? If separate images, then why the padding around them?
If you want an image like what you show with the red lines, do you want the result to be larger than the original due to the glue (padding) or do you just want to put lines into the original to show where the A4 pieces come together so that the result is still the same size?
Re: converting image to multiple a4's with glue edge ?
Posted: 2014-08-24T14:20:40-07:00
by snibgo
Another possibility: Rye wants the resulting pages to have a small overlap, with the image continuing into the overlap, so the pages can be pasted to a wall with a slight overlap and it doesn't matter which pages go on top.
Re: converting image to multiple a4's with glue edge ?
Posted: 2014-08-24T14:34:41-07:00
by Rye
snibgo wrote:Another possibility: Rye wants the resulting pages to have a small overlap, with the image continuing into the overlap, so the pages can be pasted to a wall with a slight overlap and it doesn't matter which pages go on top.
Exactly !
I guess for snipping the images this might work ?
convert -crop 64x64 +repage test.tif test%02d.tif
( is there a way to make the values here auto-adjusted by the valuesthe image has ?
Re: converting image to multiple a4's with glue edge ?
Posted: 2014-08-24T15:15:11-07:00
by fmw42
Re: converting image to multiple a4's with glue edge ?
Posted: 2014-08-24T15:15:31-07:00
by snibgo
A script could be written that would calculate the cropping parameters for each output image, according to the input size, desired amount of overlap, and desired number of tiles horizontally and vertically.
Re: converting image to multiple a4's with glue edge ?
Posted: 2014-08-24T19:56:44-07:00
by Rye
Would this script require extra functions not included in IMGMagick ?
If not... what functions should be used ?
Re: converting image to multiple a4's with glue edge ?
Posted: 2014-08-24T20:28:22-07:00
by snibgo
I suggest you experiment with the cropping-with-overlap from
http://www.imagemagick.org/Usage/crop/#crop_equal . Decide if that gives you what you want. If it doesn't, decide what else you need.
Re: converting image to multiple a4's with glue edge ?
Posted: 2014-08-25T06:57:35-07:00
by Rye
ok, that overlap seems to be what I'm looking for.
Is it possible to afterwards replace the "underlap" (of the right side images) with a white space ?
If so, what command would I have to use if I wanted to have 20x20 pixel like this ?
----------------
| SPACE |
| P ----------|
| A| |
| C| PIC |
| E | |
|--------------|
Re: converting image to multiple a4's with glue edge ?
Posted: 2014-08-28T08:13:08-07:00
by Rye
Ok, cutting with offset works fine.
Now. How can I apply a white overlay over each picture (glue space) of 55 pixels on the right side and bottom side of each picture ?
Like so:

Re: converting image to multiple a4's with glue edge ?
Posted: 2014-08-28T08:39:12-07:00
by snibgo
You can use gravity and splice, eg
Code: Select all
convert -size 100x100 xc: -gravity southeast -background Black -splice 55x55+0+0 b.png
Or gravity and extent, eg:
Code: Select all
convert -size 100x100 xc: -gravity northwest -background Black -extent 155x155 b.png
Re: converting image to multiple a4's with glue edge ?
Posted: 2014-08-28T08:44:18-07:00
by Rye
I guess I wasn't clear...
This command:
convert d-0.gif -gravity southeast -background Black -splice 55x55+0+0 d-a0.gif
will ADD a border of 55x55 on the right and down side.
So the image goes from 710x901 to 765x956
I want to add the border while OVERWRITING existing image parts (!)
so the size shall stay 710x901 with the border added.
Re: converting image to multiple a4's with glue edge ?
Posted: 2014-08-28T08:53:48-07:00
by snibgo
You can chop it before the splice:
Code: Select all
convert -size 100x100 xc: -gravity southeast -background Black -chop 55x55+0+0 -splice 55x55+0+0 b.png
Re: converting image to multiple a4's with glue edge ?
Posted: 2014-08-28T09:13:37-07:00
by Rye
Perfct !
So, this is now the finished script to slice a image (+add glue borders) to each image:
Code: Select all
@echo off
SET /P width=Please enter numer of tiles (WIDE):
SET /P height=Please enter number of tiles (HEIGHT):
convert *.* -crop %width%x%height%+55+55@ +repage +adjoin %d.gif
for %%x in (*gif) do convert %%x -gravity southeast -background White -chop 55x55+0+0 -splice 55x55+0+0 %%x
Thread can be closed