09 July 2020

PHOTO SPLICING WITH GIMP

I have a decent collection of yearbooks for my high school.  I have two flatbed scanners, a Brother multi-function device (MFC-490CW), better in quality and a Umax Astra 1220U, which has a larger scan area but only works with an older Mac laptop and can only do 150 dots-per-inch.  The older Mac laptop is a pain to use, very slow to boot up and to use, so I mostly use the Brother device whenever someone from my alumni group would like to see a page from my yearbook collection.  For most of the books, the pages fit perfectly into the scan area.  Even if the pages don't fit, I would lose only blank space on the page, or at most the page numbers, which can be at the extreme left or extreme right of the page.  For some of the older years, however, the photos would go edge to edge and my little Brother wouldn't be able to cover everything.  The situation is especially true with the faculty section.  With just one scan, some teacher would lose half of her face or a teacher on the other edge of the age would lose a third of his face.  Time to launch GIMP, the open-source photo-editing software!

Instead of just scanning the page once, I would scan it twice, or more as needed.  The first time I would focus on, say, the left edge of the page.  In the next scan, I would make sure to include the right edge of the page.  Some of the pages not only wouldn't fit horizontally they would not fit vertically either.  It is possible that I would need to scan four times of the same page.  One good thing is the Brother scanning software automatically add a number to the file name as the scans are created, e.g. 1968 p009, 1968 p009 1, 1968 p009 2, and 1968 p009 3

To get a perfect page, I would scan the same page four times, each time making sure one corner is perfect.


At last it's time for GIMP to do its work.  Mind you, GIMP does many things, but for my need, I just need to combine slices of one picture into another.  I would open all the scans of the one page in GIMP.  Let's say I will use the picture that has the right-most side intact.  It lacks a left side, some teacher's face is incomplete there.  I need to make the picture bigger so I have somewhere to paste the missing faces.  To achieve that, I would increase the Canvas Size (Image/Canvas Size...).  I always increase based on percentage and 10 more does the job.  The default is to expand on the right side and/or the bottom side.  In this case, I want to expand the left side and the bottom side, so I moved the preview picture around.  Should I want to increase the size uniformly on all sides, I would click the Center button.

Move the preview picture around to decide the new expand area.


When I scanned the yearbook page, it created a PNG file, a standard picture format.  Once I start to edit the file in GIMP, it takes on the XCF format that is used by GIMP.  One big difference between XCF and PNG is the use of Layers.  PNG has limited support for Layers, when you copy and paste, the pasted material is temporarily on its own Layer and can be moved around.  Once you close the file, the Layer is no longer there, whatever it had is now part of the file and cannot be moved easily like before.  Our picture with the expanded canvas size is ready to take on a paste and give it its own layer.  However, the expanded area is transparent and may not properly show the pasted material.  I find it best to instantly flatten the document (Image/Flatten Image) so that the expanded area takes on the property of the document.

After the Resize button was clicked, the picture is bigger, but the new area may not show pasted content.
Flattened, the expand area is now ready to receive paste content from the other three pictures.

I learned Photoshop before I used GIMP.  While GIMP probably does most things Photoshop does, the way GIMP works is a tad different.  So I went to the picture that has my missing right side.  I would copy the entire faces of the right edge, usually a whole strip from the top of the page down to the bottom.  With Photoshop, when I paste it into the first picture, I would be able to move the pasted item right away.  With GIMP, I would have to first select xyz, then I can move it around.  Before I discovered this difference, it was such a pain to move anything around after pasting.  I don't know how I did it, I just know it was painful.  I find it somewhat helpful if I zoom in, so I can better align the pieces.

With the piece from another picture copied and pasted, I have to make sure to choose the lower button, Move the Active Layer, before I try to move the piece into place.

That's all there is to it.  Scan multiple times of the same page, each scan covering each edge.  Expand the canvas size of one document, flatten the file to fill in the new, expanded area.  Copy and paste as needed, but make sure to select what to move.  Now you just have to carefully move the segments into position so all the faces are complete.  I have yet to find a way to move a floating selection by keyboard combos so it's such a pain to move with the trackpad on my Mac laptop, but that I can live with.  I usually save in the XCF format the file that has all the pasted items.  Then I export that file to PNG and delete the other files to save space.

The final product.  Not perfect, as you can see a little gap in the upper left corner, but all teachers have their faces fully displayed.

No comments:

Post a Comment