View Single Post
Old 10-20-2010, 06:51 PM   #119
lilman
Addict
lilman has learned how to read e-bookslilman has learned how to read e-bookslilman has learned how to read e-bookslilman has learned how to read e-bookslilman has learned how to read e-bookslilman has learned how to read e-bookslilman has learned how to read e-bookslilman has learned how to read e-books
 
lilman's Avatar
 
Posts: 326
Karma: 960
Join Date: Jul 2009
Location: Florida, US
Device: Kindle DX, iPad
Quote:
Originally Posted by badbob001 View Post
Does this have anything to do with Color Balancing?
I think color balancing is more related to gamma than contrast. Contrast is how distinct things in the image look in comparison to other things. For example, after increasing contrast what was once a mere speck looks a lot more noisy. I don't like auto balancing color or contrast since I think it is something that should be left to the human eye to decide, but it was requested so I included it.

Quote:
Originally Posted by badbob001 View Post
I'm not sure how auto_split_buffer size relates with solid color borders. But it is a brain twister since you calculate the auto_split_buffer and split BEFORE your resize BUT only after you resize do you realize if the auto_split_buffer amount is too much (ie: top/bottom borders introduced due to split image being too wide).
Yes, the auto_split_buffer is calculated and used before resizing; however, once you say that you want to use the split_buffer, it gets used. There is no later processing to say "the split buffer was too much, let's crop it down". The split_buffer is not treated as a border, it becomes part of the image.

To sum up the logic since it can be a bit confusing:
1) Find the x coordinate for a page split
2) Split the image. If the user specified a split buffer, move the x coordinate a bit for each page side before performing the split (so each page may have a different x split coordinate when using a split buffer)
3) Process the split pages like normal (trim, resize, etc.)
4) Add borders if the user requested them and they are needed

That should explain why I couldn't implement using split_buffer as a border. Once a landscape scan has been split in two, each page is treated independent of the other. Each page may be trimmed, resized, etc. differently than the other. You can't go back later and say "I want to use some of you as a border for this other page" since there is no guarantee that they will still be properly aligned. The alternative is to know ahead of time how big the image is going to be after resizing, and this would be possible if ImageMagick didn't handle the trimming (i.e. Canti could predict a simple image resize, but not including an unknown amount of trimming).

I hope that explains it.
lilman is offline   Reply With Quote