Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 10-21-2010, 11:26 AM   #121
badbob001
Fanatic
badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.
 
badbob001's Avatar
 
Posts: 556
Karma: 1102020
Join Date: Sep 2009
Device: Kindle Keyboard (rip), Kindle Voyage, Fire Tablet 10 '17, iPad '19
I understand. ImageMagick is an external app and you can't predict its output. The only thing you could do is let Convert process the image, analyze the result, and re-do the process. Too bad convert doesn't have a test mode so you can just see what it's going to do.

I think auto-level may be closer to what is described as color balancing.

I've seen that +repage is needed for operations that affect the size of the image, such as trimming. Have you tried that to see if it helps with the gif issue?
http://www.imagemagick.org/discourse...hp?f=1&t=14942
badbob001 is offline   Reply With Quote
Old 10-21-2010, 01:50 PM   #122
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 hupple View Post
I have tried -auto-gamma. -auto-level and -contrast. I agree that auto-gamma doesn't work well. But auto-level is better.
Quote:
Originally Posted by badbob001 View Post
I think auto-level may be closer to what is described as color balancing.
All my digital scans are manga so I don't have a good testbed for color correction testing. But since you both recommend auto-level I will include it in the next update.

Quote:
Originally Posted by badbob001 View Post
I understand. ImageMagick is an external app and you can't predict its output. The only thing you could do is let Convert process the image, analyze the result, and re-do the process. Too bad convert doesn't have a test mode so you can just see what it's going to do.
Predicting the resize is easy, but predicting the amount of trim isn't possible. Writing my own trim algorithm wouldn't be too difficult since I already developed the necessary base code for analyzing images when I wrote the auto_split_landscape_scans feature, but I'm not sure Java can handle as many input image types as ImageMagick. Not being able to use the split_buffer as a border isn't that big of a loss anyway.

I kind of want to write my own image handling library and cut ImageMagick out completely. Oh well, a project for another time.

Quote:
Originally Posted by badbob001 View Post
I've seen that +repage is needed for operations that affect the size of the image, such as trimming. Have you tried that to see if it helps with the gif issue?
http://www.imagemagick.org/discourse...hp?f=1&t=14942
Nice find. I was only using "-repage -1-1!" to account for adding a 1px border of the desired trim color, but since that 1px border gets trimmed anyway, using +repage will readjust the canvas size data for both the 1px border and the trimmed space from the original image. .gif issue should now be fixed, although from what I've been reading lately .png is a better alternative than .gif.
lilman is offline   Reply With Quote
Advert
Old 10-21-2010, 02:16 PM   #123
hupple
Junior Member
hupple began at the beginning.
 
hupple's Avatar
 
Posts: 6
Karma: 10
Join Date: Oct 2010
Device: Kindle DX
Quote:
Originally Posted by lilman View Post
All my digital scans are manga so I don't have a good testbed for color correction testing. But since you both recommend auto-level I will include it in the next update.
I test auto-level with grey tone manga scans. And it is good.

Auto-level Description:

This is a 'perfect' image normalization operator. It finds the exact minimum and maximum color values in the image and then applies a -level operator to stretch the values to the full range of values.
hupple is offline   Reply With Quote
Old 10-22-2010, 09:39 AM   #124
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
Progress report on what I've been working on for the next release of Canti:

-[code done] Contrast adjustment (user requested)
Ability to adjust the contrast of images. Personally I don't like this feature... contrast is one of those things you shouldn't leave up to a batch job, but instead should be done manually on a per image basis. But someone requested it, and it is a feature of ImageMagick so it wasn't hard to add to Canti. The same user also requested implementing ImageMagick's auto-gamma feature, but I tried it out and it really doesn't work well on manga scans so it will not be included.
-[code done] Auto-level (user requested)
Uses the -auto-level feature of ImageMagick. This works a whole lot better than contrast adjustment on manga scans, although I'm not sure if it really makes the scans look better (at least it doesn't make them look obviously worst).
-[code done] Handle read-only parent_folder (user requested)
Canti normally uses parent_folder for some temporary files (namely unarchiving zips/rars in parent_folder, or converting a pdf in parent_folder to an image folder), but this isn't possible if parent_folder is read-only. I was afraid this would be difficult to implement, but it turned out to be pretty easy.
-[code done] Handle resizing using different orientation from original image
I'll explain this when the update is released... it was tricky.
-[dropped] When using @auto_split_landscape_scans and @add_border, use split_buffer as horizontal border (user requested)
This isn't possible short of reprocessing from the unsplit scan or handling image trimming through Canti rather than ImageMagick. This feature has been dropped for now.
-[code done] Directional add_border (user requested)
Instead of centering the scan when adding a border, add horizontal border to simulate the original physical page side (left or right) of the scan. This of course could only be used on landscape split scans since it is impossible to determine the original page side of a scan otherwise.
-[code not started] Sharpen image
I'm interested in exploring ImageMagick's sharpening abilities to see if they should be included in manga processing.

If anyone has any other requests, please let me know now. Once this update is done I want to leave Canti alone for a while and get back to my other project.

Last edited by lilman; 10-22-2010 at 11:58 AM.
lilman is offline   Reply With Quote
Old 10-22-2010, 01:11 PM   #125
badbob001
Fanatic
badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.
 
badbob001's Avatar
 
Posts: 556
Karma: 1102020
Join Date: Sep 2009
Device: Kindle Keyboard (rip), Kindle Voyage, Fire Tablet 10 '17, iPad '19
FYI: ImageMagick does not support lossless jpeg operations. It reads in the whole image like Photoshop.
http://www.imagemagick.org/discourse...t=9023&p=27893
badbob001 is offline   Reply With Quote
Advert
Old 10-22-2010, 02:15 PM   #126
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
Here's Canti v1.93

Note: Thanks to everyone for their input, a lot of the features in this update were user requested.
Note 2: I was doing too many code changes at once so I decided to release the update in its current state. There is still some stuff I am working on so expect another update in the not too distant future.


New to version 1.93:
-Bug fix: Kindle bookmark may be incorrect
When first created, the Kindle bookmark should point to the first image in the folder (for example, 0000.jpg).
However, Canti was using the name of the first image prior to processing, meaning that if the file extension changed (for example, .png -> .jpg) then the bookmark wouldn't point to the new name.
This has been fixed.
-Bug fix: When resizing to another orientation, the orientation geometry was ignored
This is a bit hard to explain, let me just give an example. If you set @width to 600 and @height to 800 (i.e. a portrait scale) and tried to resize a landscape scan, the resize geometry was reversed.
This was an issue with the way ImageMagick interprets resize calls, but I was able to fix it by giving Canti some more intelligence when making the resize call to ImageMagick.
-Auto split page side borders
If you enabled @auto_split_landscape_scans and @add_border, this determines if split scans should have borders added to the left/right side to best represent the original physical page side.
As a more visual example, enabling this feature will result in [border][left page] for the left page of a split and [right page][border] for the right page of a split.
This is set up in the .properties file.
-Meaning of @auto_rotate changed
Before, @auto_rotate would rotate all landscape scans to portrait orientation.
Now, @auto_rotate rotates any scan whose orientation does not match the target orientation (based on @width and @height).
If @width and/or @height is set to -1, then target orientation is assumed to be portrait.
This is set up in the .properties file.
-Adjust contrast
Adjusts the contrast level of the output images.
The value represents how many times the contrast adjustment alogrithm should be run on an image (for example, a value of 3 would result in the contrast algorithm being run three times).
A positive value will increase contrast, a negative value will decrease contrast, and a value of 0 leaves the contrast unmodified.
Personally I think contrast adjustments should be done manually on a per image basis (so I leave this disabled). If you are going to use this feature, I recommend using a small value (1 or -1).
This is set up in the .properties file.
-Auto-level
Uses the ImageMagick -auto-level feature to balance colors.
Description from the ImageMagick website: "It finds the exact minimum and maximum color values in the image and then applies a -level operator to stretch the values to the full range of values."
This is set up in the .properties file.
-Handle read-only parent_folder
Canti normally uses parent_folder for some temporary files (namely unarchiving zips/rars in parent_folder, or converting a pdf in parent_folder to an image folder), but this isn't possible if parent_folder is read-only.
Now Canti can handle a read-only parent_folder. If Canti detects that parent_folder is read-only, it will use a temp folder in output_folder.
Of course, if parent_folder is read-only, features like @archive_parent_image_folders and @unarchive_parent_image_archives are disabled.
-New Other Operation: Analyze Manga Folder
Canti will analyze all the image files in the given manga folder and give you image statistics such as width, height, and dpi.
This is strictly for testing purposes and is not needed for manga processing.
See the -Other Operations- section of the readme for more details.
-New device: k3
You can specify "k3" as your device when creating a .properties file. Not a big deal since the specs for the k3 are the same as for the k2.
-Various bug fixes and optimizations
You know the drill, every time I tinker with the code I always find little things to fix.

Enjoy
Attached Files
File Type: zip Canti_v1.93.zip (122.2 KB, 254 views)
lilman is offline   Reply With Quote
Old 10-25-2010, 12:02 PM   #127
iamchenxin
Junior Member
iamchenxin began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2010
Device: kindle 3
nice work.
thanks.
iamchenxin is offline   Reply With Quote
Old 10-30-2010, 10:11 PM   #128
badbob001
Fanatic
badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.
 
badbob001's Avatar
 
Posts: 556
Karma: 1102020
Join Date: Sep 2009
Device: Kindle Keyboard (rip), Kindle Voyage, Fire Tablet 10 '17, iPad '19
So far so good. Thanks!
badbob001 is offline   Reply With Quote
Old 10-31-2010, 12:32 PM   #129
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
A very, very early preview of things to come:



Do not be taken aback by the ugliness of the gui, I haven't even touched Photoshop yet. But at least I got the basics working:
-Clicking "Select parent_folder" brings up a file chooser
-Clicking "Run" will run Canti using the given data
-Output of Canti is displayed live in a window of the gui
-Gui is separate from Canti. Canti will still be delivered as a jar with only command line functionality, but you will be able to download this gui as a separate jar and point it to the Canti jar. This is good for two reasons:
1) People who don't want to use a gui (like me) can continue using Canti through command line
2) Development of Canti and CantiGUI are kept separate, making the code a lot easier to deal with

There is a lot more to do:
-Add in all the other Canti command line options (right now there is just the bare minimum: parent_folder and title)
-Make the gui look good
-Various gui coding such as thread management

Don't expect a release any time soon, this is going to take a while
lilman is offline   Reply With Quote
Old 11-04-2010, 10:27 AM   #130
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
Update on gui progress:



-[coding done] "Advanced" tab, where you set the optional runtime settings (like manga_prefix)
-[almost done coding] "Settings" tab, where you create, load, and/or edit the .properties file
-[coding in progress] I want to keep Canti separate form its gui, but doing so is a bit problematic. I'm still trying to decide the best way to handle this.
-[almost done coding] Save/Load jobs
-[coding in progress] "Help" section

I think I will release the first version of the gui without any custom graphics (i.e. ugly but simple) just so people can play with it and make sure it is working properly. Afterwards I can focus on making it look good. Expect a release within 2-3 weeks.

Last edited by lilman; 11-11-2010 at 12:18 PM.
lilman is offline   Reply With Quote
Old 11-11-2010, 05:23 PM   #131
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
CantiGUI is progressing nicely. All of the hard stuff (file management, thread management, job management, etc.) is done. Just finishing up all the little things... there are a lot of them.

I didn't plan on using this gui myself, but the save/load jobs feature makes reprocessing a series much more convenient than looking up the command line from the batch creator. With this gui in place you will never have to touch the command line again; even .properties creation and editing is handled within the gui. Of course if you prefer the command line, Canti will still be delivered as a command line only program (i.e. CantiGUI relies on Canti, but Canti doesn't need CantiGUI). Expect a release within a week.

-Update 11/13-
So close to being done. I think the last lingering to-do is error log handling. After that I just have to make the usual updates to Canti and then we're good to go. There will be two distributions:
1) Canti (the same as before, a command line .jar)
2) CantiGUI with Canti (executable jar with the command line jar in its library)
Expect a release within 3 days.

-Update 11/14-
CantiGUI code is done! Working on the javadoc (tedious, but necessary), then I'll update Canti a bit and package it for release.

-Update 11/14 Part 2-
CantiGUI is now ready for release. Just need to finish up some stuff with Canti.

Last edited by lilman; 11-14-2010 at 02:11 PM.
lilman is offline   Reply With Quote
Old 11-11-2010, 07:34 PM   #132
Nathan Campos
Groupie
Nathan Campos ought to be getting tired of karma fortunes by now.Nathan Campos ought to be getting tired of karma fortunes by now.Nathan Campos ought to be getting tired of karma fortunes by now.Nathan Campos ought to be getting tired of karma fortunes by now.Nathan Campos ought to be getting tired of karma fortunes by now.Nathan Campos ought to be getting tired of karma fortunes by now.Nathan Campos ought to be getting tired of karma fortunes by now.Nathan Campos ought to be getting tired of karma fortunes by now.Nathan Campos ought to be getting tired of karma fortunes by now.Nathan Campos ought to be getting tired of karma fortunes by now.Nathan Campos ought to be getting tired of karma fortunes by now.
 
Nathan Campos's Avatar
 
Posts: 194
Karma: 250000
Join Date: Nov 2009
Location: Brazil
Device: Kindle DX & Kindle (2011)
Great job mate!
Nathan Campos is offline   Reply With Quote
Old 11-11-2010, 11:02 PM   #133
kindleapple
Junior Member
kindleapple began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Nov 2010
Device: Kindle PW3 5.16.2.1.1
Canti is definitely the best thing I've used to format manga for my Kindle. Works beautifully on Linux
kindleapple is offline   Reply With Quote
Old 11-14-2010, 03:14 PM   #134
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
Here's Canti v1.94 and CantiGUI v1.00

Note: If you want CantiGUI, you don't need to download Canti separately... it is already included in the archive.
Note 2: CantiGUI is brand new, so there is a good chance of bugs. If you experience any problems please let me know.


New to Canti v1.94:
-Goodbye @max_dpi
A Canti user pointed out to me that dpi does not effect image rendering on ereader devices.
Dpi relates directly to printing, but for a long time I thought there was a virtual correlation with screens as well. I no longer think so, so @max_dpi is now disabled by default.
I left it as an option in case you want to use it for printing.
-Despeckle
Uses the ImageMagick -despeckle feature.
The value represents how many times the despeckle algorithm should be run on an image (for exmaple, a value of 3 would result in the despeckle algorithm being run three times).
Note that if you enabled this feature and @auto_trim, the first despeckle operation will occur before trimming.
Acceptable values: 0 (to disable), an integer between 1 and 5 inclusive
Recommended value: If your scans aren't too noisy just leave this disabled (0). If you are going to use this feature, a low value (1) is recommended, otherwise the image can lose a lot of detail.
This is set up in the .properties file.
-Reorganized .properties file
Moved stuff around, added Advanced section.

New to CantiGUI v1.00:
-Initial release
This is the initial release of CantiGUI. There are no custom graphics included in the gui... at all. It looks ugly but should be functional.
When I get time later I will work on making the gui look good.
-Load/Save Jobs
This is a feature not available in the command line version of Canti. It allows you to save a job for future reprocessing.
A job is basically the state of the gui at the time of saving (so it includes things like parent_folder, title, etc.).
Previous jobs are displayed in a table with rows sorted by title.

Enjoy and let me know if CantiGUI works for you
Attached Files
File Type: zip Canti_v1.94.zip (123.6 KB, 224 views)
File Type: zip CantiGUI_v1.00.zip (162.5 KB, 237 views)
lilman is offline   Reply With Quote
Old 11-14-2010, 04:30 PM   #135
kindleapple
Junior Member
kindleapple began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Nov 2010
Device: Kindle PW3 5.16.2.1.1
When faced with a chapter in two parts, say 25a.zip and 25b.zip, Canti extracts one as title_-_ch with no number and it gets slapped at the front of the first volume, the other doesn't seem to be extracted anywhere.
kindleapple is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Canti: Manga Processing Program lilman Workshop 42 04-14-2011 06:52 PM
Canti: Manga Processing Program lilman Apple Devices 55 04-14-2011 05:50 PM
Classic Canti: Manga Processing Program lilman Barnes & Noble NOOK 4 07-14-2010 04:45 PM
Canti: Manga Processing Program lilman Sony Reader Dev Corner 1 07-14-2010 04:43 PM
Best for manga eqzitara Which one should I buy? 27 11-19-2007 07:58 AM


All times are GMT -4. The time now is 02:24 PM.


MobileRead.com is a privately owned, operated and funded community.