Daniel Reetz, the founder of the DIY Book Scanner community, has recently started making videos of prototyping and shop tips. If you are tinkering with a book scanner (or any other project) in your home shop, these tips will come in handy. https://www.youtube.com/channel/UCn0gq8 ... g_8K1nfInQ

Mac OSX Instructional: Order & Prepare Images for ScanTailor

Share your software workflow. Write up your tips and tricks on how to scan, digitize, OCR, and bind ebooks.
Post Reply
univurshul
Posts: 496
Joined: 04 Mar 2014, 00:53

Mac OSX Instructional: Order & Prepare Images for ScanTailor

Post by univurshul » 19 Aug 2010, 15:15

For OSX users, I've developed a simple, fast and free instructional that is a precursor to processing images with Scan Tailor (or any image editor/ebook builder you prefer). This instructional is for users with 2 camera scanning systems that are looking for an efficient way to order their images accurately prior to processing for ebook construction.

This method utilizes free Apple software found on factory shipped OSX versions. This workflow has been running successfully with the following versions:

iPhoto 8.1.2 OSX Snow Leopard
If prior versions of iPhoto perform the outlined steps below, please reply to the post.

STEP 1: Import Raw Images from Cameras
Each camera will offload the images onto iPhoto where they are called 'events'. For learning purposes, label each event to correspond to the left and right cameras (this will eventually help you understand how to interleave the events into proper page ordering in a later step.)
STEP 1.jpg
STEP 1.jpg (56.48 KiB) Viewed 11853 times
STEP 2: Rotate all images in each event.
Select all images in the left camera event. command-R will rotate clockwise 90 degrees each time you enter this key command. (Although Scan Tailor has a rotating feature, batch rotating the images in each event prior to their merging is faster and easier if you perform it on this step.) Repeat the above rotation steps in the right camera event.
STEP 2.jpg
STEP 2.jpg (107.3 KiB) Viewed 11853 times
STEP 2.5.jpg
STEP 2.5.jpg (56.01 KiB) Viewed 11853 times
STEP 3: Batch Change 'Dates'
This step is crucial to get correct. The first couple trys may take time to understand correct order of operations, but once you do it successfully, it will make perfect sense.

Image Order Theory: The right camera always takes the first image, i.e., page 0 (which is a black blank void if you capture book covers on the opposing left camera). The left camera takes the 2nd sequential image, or the book cover, a.k.a Page 1. Because we always will want the cover to be the first page, we will delete the 0 page. Make sure you delete the 0 page before batch processing the dates as described in this step:

(Depending on what image you shoot as page 1, you should date that corresponding event accordingly.)

Now that we have identified Page 1, we can begin ordering our images for book compiling. Select every image within the left camera event and control-click> a menu will appear> select "Batch Change..."> select "Date" in the selection box> batch change every image starting at 12:00:00am, with 1 minute intervals between each photo.> "Modify Original Files" should NOT be checked, as this will save you time.
STEP 3.jpg
STEP 3.jpg (98.35 KiB) Viewed 11853 times
Next, we will go into the right camera event and select every photo and batch change dates just like in the right camera event. Except we will change the starting to date to 12:00:30am, with 1 minute intervals between each photo. (What we did here was stagger or offset the dates of the photos in the right camera event to interleave in sequential page order with the left camera event."Modify Original Files" should NOT be checked, as this will save you time.

STEP 3.5.jpg
STEP 3.5.jpg (96.76 KiB) Viewed 11853 times
STEP 4: Combine Left & Right Camera Events
Exit out of the right camera event and into the events overview in iPhoto. Drag either event into the other (doesn't matter which one combines with what).
STEP 4.jpg
STEP 4.jpg (77.3 KiB) Viewed 11853 times
Go into the merged event by double tapping or clicking. Make sure that view>sort photos>by date is selected in the iPhoto menu. This is a good time to zoom-in on photos (by pressing the space-bar, NOT the return key) to check if the pages interleaved correctly. If they did, great. If they didn't, you have the option to undo this merge. (FYI: the minute you start editing photos, or use the return-key to zoom in on photos after you merged 2 events, you will lose the option to undo this procedure. My advice is to confirm that the pages interleave correctly, but if they don't, locate the page number where it falters, mark it with a star rating, and then undo the merge. My experience shows this is easier, as fixing a merged mess of photos can take a long time. Another useful tip is to set the firmware on one of your cameras to count images in continuous mode, and another in cyclical starting at 1. --This way if you lose the option to un-merge events, you can sort the view according to file name).

STEP 5: Batch Change Image Titles to Sequential Numbers
In the merged event, select all the images, contrl-click "Batch Change..", and from the the selection box choose "Title-to-Text". I leave it blank for speed of my workflows, but you can append any name in front of the sequential page ordering. Make sure "Append number to each photo" is checked. This will order every page sequentially.
STEP 5.jpg
STEP 5.jpg (100.63 KiB) Viewed 11853 times
STEP 5.5.jpg
STEP 5.5.jpg (104.26 KiB) Viewed 11853 times
STEP 6: Checking for Missing Pages
This is really useful for checking to see if you missed/skipped/duplicated any pages when you scanned your book. (if you purposefully skipped pages, such as a magazine with advertisements, this step won't be of much use).

All you need to do here is locate the true Page 1 within the physical book. Once you find wherever page 1 is located, select every image from there to the end of the book. Follow the steps in STEP 5 to batch change the title of these selected images. Once you have renumbered the images in relation to their physical page numbers, zoom in on an image near the end of the book. If the page number correctly corresponds to the title of the image, then you can conclude the page ordering is correct, and you did not skip any pages during the scan.
STEP 6.jpg
STEP 6.jpg (86.58 KiB) Viewed 11853 times
If the numbers do not matchup, you can simply skim through the images until you find the mis-matched/missing/duplicate pages. There are a number of tricks to insert missing pages in iPhoto. If you run into problems, I can elaborate in detail how to make edits in your events. But it should be a rare occurrence if you scan thoroughly and follow this instructional.
STEP 6.5.jpg
STEP 6.5.jpg (85.35 KiB) Viewed 11853 times
Once page order is finally corrected, batch change the entire set of images for the book again as mentioned in STEP 5 (this assures proper ordering upon loading the images into Scan Tailor)

STEP 7: Cut Out the Fat
You'll want to remove blanks or worthless images at this step. They serve no purpose to process, export, so once correct page order is achieved into a single event, you can toss these images without hindering page order. You can cut the image from the event the image by simply pressing delete.

(NEVER CUT THE FAT WHEN YOU HAVE 2 SEPARATE EVENTS; YOU WILL DISRUPT SEQUENTIAL PAGE ORDERING!!)

STEP 8: Export images for Post Processing
Once you have a clean-ordered set of images ready for post-processing, it is time to export these versions & their modified titles to a new file folder for Scan Tailor. In event view in iPhoto, select the event you want to export. In the iPhoto main menu, select [File>Export...] Make sure that "Current" and "Use Title" are selected in the appropriate dialog boxes.
STEP 8.jpg
STEP 8.jpg (67.35 KiB) Viewed 11853 times
STEP 8.5.jpg
STEP 8.5.jpg (84.86 KiB) Viewed 11853 times
STEP 8.75.jpg
STEP 8.75.jpg (65.39 KiB) Viewed 11853 times
If you have any suggestions which could make this workflow faster, easier, etc., please share you ideas.
Last edited by Anonymous on 26 Oct 2010, 01:08, edited 6 times in total.

User avatar
n9yty
Posts: 72
Joined: 25 Jul 2010, 22:13

Re: Mac OSX Instructional: Order & Prepare Images for ScanTa

Post by n9yty » 20 Aug 2010, 00:23

Great notes. Since I don't have a real rig yet, just two cameras on tripods at different focal lengths and a unstable cardboard base with a gorilla glue lexan platen... I need to process my even and odd pages separately because they have different DPIs.

So, I have been using "Image Capture Utility" to import the images into even and odd folders, FileWrangler to renumber them as 001, 003, etc and 002, 004, etc. Then I process each folder through scantailor, and merge the final output files to generate a PDF.

At some point I may do a write up in more detail like the excellent post above, but documentation isn't my strong point.

And a note that a Universal Binary for Intel/PPC Mac OS X 10.4+ is available here. All future builds will be done this way unless something prevents it. That is the "dewarp trial", but as far as I know none of the core functionality is altered from 0.9.9.1 so it should be fine to use. I do.

User avatar
daniel_reetz
Posts: 2785
Joined: 03 Jun 2009, 13:56
E-book readers owned: Used to have a PRS-500
Number of books owned: 600
Country: United States
Contact:

Re: Mac OSX Instructional: Order & Prepare Images for ScanTa

Post by daniel_reetz » 20 Aug 2010, 08:26

At some point I may do a write up in more detail like the excellent post above, but documentation isn't my strong point.
Give it a shot, I know I'd love to see it... and other people here can always help out a bit with weak spots, if there are any.

User avatar
daniel_reetz
Posts: 2785
Joined: 03 Jun 2009, 13:56
E-book readers owned: Used to have a PRS-500
Number of books owned: 600
Country: United States
Contact:

Re: Mac OSX Instructional: Order & Prepare Images for ScanTa

Post by daniel_reetz » 27 Aug 2010, 10:53


tristan
Posts: 1
Joined: 04 Mar 2014, 00:52

Re: Mac OSX Instructional: Order & Prepare Images for ScanTa

Post by tristan » 18 Sep 2010, 17:48

Hi,
this is a great Tutorial.
But i have still one question - is it possible to bring the photos in correct, if you are (like me) just using one camera. You handle this problem quite nice with the order by date - but in my case thats not working.
Thanks.

univurshul
Posts: 496
Joined: 04 Mar 2014, 00:53

Re: Mac OSX Instructional: Order & Prepare Images for ScanTa

Post by univurshul » 18 Sep 2010, 18:02

Ordering by 'date' should still work with one camera. Recheck you're viewing the event & photos by 'date'. What version of iPhoto are you using?

It sounds like your importing both odd and even pages into a single event because you're shooting the entire book on one memory card. Typically, when you offload the images, they end up getting compiled into one event in iPhoto.

In the case of a single camera, shoot all even pages, import to an event in iPhoto, erase the memory card, then shoot all the odd pages, import into another separate event in iPhoto, erase the memory card. Then follow the tutorial.

If you think you can shoot the entire book on one memory card and then segment the even and odd pages into separate events after offloading in iPhoto, then what you would do is extract & drag the even pages into a new event (simply highlight the start and end of the even pages then drag the selected images over to the inspector icon labeled 'events'--it might ask you to create a new event; click yes. Then follow the tutorial.

User avatar
clemd973
Posts: 121
Joined: 22 Aug 2010, 21:20

Re: Mac OSX Instructional: Order & Prepare Images for Proces

Post by clemd973 » 20 Oct 2010, 22:59

This batch change for the timestamp is GREAT for putting the pages in sequential order. However, what I noticed was that when I exported from iPhoto '09 and saved the file, when I opened it up in Scan Tailor, the sequential order was lost because Scan Tailor and other programs seem to read the file name and not the timestamp. So even if you changed the Title in iPhoto, it did not change the original filename.

The work around I found was to Export from iPhoto (I use v.'09) using the "Sequential" option under "File Name": File > Export; Under "Kind", select TIFF; Under "Size", select "Full Size"; Under "File Name", select "Sequential"; Under "Prefix for Sequential", enter your desired prefix - perhaps the initials of your project (?).

Hope this helps you Mac users out there.

univurshul
Posts: 496
Joined: 04 Mar 2014, 00:53

Re: Mac OSX Instructional: Order & Prepare Images for Proces

Post by univurshul » 20 Oct 2010, 23:55

clemd973 wrote:However, what I noticed was that when I exported from iPhoto '09 and saved the file, when I opened it up in Scan Tailor, the sequential order was lost because Scan Tailor and other programs seem to read the file name and not the timestamp.
Hi clemd973,

Excellent, good to hear this helps your workflow...

iPhoto '09 is version 8.x

Regarding your error: It appears the first glance at your issue looks as if you missed STEP 8:
Export images for Post Processing
Once you have a clean-ordered set of images ready for post-processing, it is time to export these versions & their modified titles to a new file folder for Scan Tailor. In event view in iPhoto, select the event you want to export. In the iPhoto main menu, select [File>Export...] Make sure that "Current" and "Use Title" are selected in the appropriate dialog boxes.
--Change the title of every image and then export using the title, which transforms the title-to-file name. Once you change the titles as you discovered on your own, you'll notice you no longer need the time stamps. BOOM!

User avatar
clemd973
Posts: 121
Joined: 22 Aug 2010, 21:20

Re: Mac OSX Instructional: Order & Prepare Images for Proces

Post by clemd973 » 21 Oct 2010, 13:34

univurshul wrote: Regarding your error: It appears the first glance at your issue looks as if you missed STEP 8:
Thanks for the clarification, but it seems that I first missed step 5! :) You've got it ALL spelled out here; I just didn't read it close enough. I did, however, learn a bit more about how iPhoto works, ha, ha. Thanks, again.

sanzoghenzo
Posts: 5
Joined: 11 Nov 2011, 07:35
Number of books owned: 0

Re: Mac OSX Instructional: Order & Prepare Images for ScanTa

Post by sanzoghenzo » 24 Jan 2013, 16:10

Sorry if I resume this post, but I think you can do this in a more automated way using just the basic osx thanks to automator services (snow leopard and up). No need to use iphoto.
I'm italian so it's better not to fill my howto with pictures you can't understand :P but here's how to do.
  • First, I assume you took pictures starting from right page. One or two cameras, doesn't matter.
  • Open Automator and select "service" in the new automator workflow dialog.
  • At the top of the right pane select "image documents" from "finder"
  • now use the search box in the library (left pane) to look for "rotate images" and double click it or drag it in the right pane.
  • A dialog will appear, asking to backup your file before you mess with them. It's up to you, I normally don't care since I already have a copy somewhere, but it could be good if anything goes wrong to have originals.
  • select "right" in the "rotate images" box
  • now add "sort finder elements", and chose by "name" "ascending"
  • add "rename finder elements" and ignore the backup message. Choose "make sequential", add number to "new name" and type "A" in the text box, place number "before name" starting from "1", then make sure you create all numbers with 3 or 4 digits (it depends on how many pages you have).
  • Save the workflow/service with name like "Order and rotate right pages"
  • You have to create a similar workflow for left pages. You can do it in a very fast way: in "rotate image" select "left" and in "rename finder elements" just change the name to "B", then save as and use a name like "Order and rotate left pages".
Ok, enough of Automator, you can forget it for the rest of your life (well, if could be useful for a bunch of other workflow automations!)

Now your post capture workflow will look like this:
  • Use Image Capture app to download your pictures on your hard drive, creating two distinct folders for right and left pages
  • check if the pictures are in the correct order, that there's no missing or duplicate pages. quicklook (hit space in finder with images selected) can help in this process. If you have to insert some missing page, just rename it like the image on the position before and add some character (i use "a","b", and so on), so they are on the right order if sorting by name.
  • Now select all the images, right click and select "Order and rotate right pages" (or left, depending in which folder you are). if you can't see that option, it's probably nested in "services" item.
  • repeat for the other folder, then merge the two folders and fire up scantailor!
of course if you start with left pages, you simply have to swap the names in the "rename finder items" boxes of the two services (services are located in ~/Library/Services, but you can find them in the open recent menu).
Automator has the ability to create image capture plugins, but I prefer this method so I can do the checks within finder.
Of course you can do all this with Homer, but since I can't use it anymore (think I messed up with homebrew) and I heard it's no longer mantained, I prefer to stick with what OSX offers me.

Post Reply