mirror of
https://github.com/ciromattia/kcc
synced 2026-09-14 14:57:07 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4261958bd | ||
|
|
cb7592dcd0 | ||
|
|
ea532c709b | ||
|
|
1ce92bac83 | ||
|
|
5b67d4019e | ||
|
|
2423e2e44a |
@@ -58,7 +58,7 @@ jobs:
|
||||
name: windows-build-${{ matrix.entry }}
|
||||
path: dist/*.exe
|
||||
- id: optional_step_id
|
||||
uses: signpath/github-action-submit-signing-request@v2.3
|
||||
uses: signpath/github-action-submit-signing-request@v3.0
|
||||
if: ${{ github.repository == 'ciromattia/kcc' }}
|
||||
with:
|
||||
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
|
||||
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
name: windows7-build
|
||||
path: dist/*.exe
|
||||
- id: optional_step_id
|
||||
uses: signpath/github-action-submit-signing-request@v2.3
|
||||
uses: signpath/github-action-submit-signing-request@v3.0
|
||||
if: ${{ github.repository == 'ciromattia/kcc' }}
|
||||
with:
|
||||
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
|
||||
|
||||
@@ -55,19 +55,23 @@ You can view the split halves either before or after combined spreads:
|
||||
|
||||
Just drop your input files into the KCC window, hit convert, and USB drop the output files onto your device's `documents` folder!
|
||||
|
||||
https://github.com/user-attachments/assets/da73d625-e082-482d-91a4-ae4765e96fd7
|
||||

|
||||
|
||||
There are a lot of options, but most people only care about the ones checked above.
|
||||
|
||||
Hover over each option to see details in a tooltip.
|
||||
|
||||
NOTE: some checkboxes can have a half-check marks.
|
||||
|
||||
Then all your usb loaded comic files will show up next to all your normal books in your ereader library!
|
||||
|
||||
Here's a quick video demo of how the process works (using expert mode):
|
||||
|
||||
https://github.com/user-attachments/assets/da73d625-e082-482d-91a4-ae4765e96fd7
|
||||
|
||||
The final result looks incredible on my 10" Kindle Scribe: https://www.youtube.com/watch?v=2CIHW2N9Enc
|
||||
|
||||
**WARNING**: Kindle Scribe 2025 MOBI support may have blank pages. Use PDF instead.
|
||||
|
||||
The GUI looks like this, built in Qt6.
|
||||
There are a lot of options, but most people only care about the ones checked below.
|
||||
Hover over each option to see details in a tooltip.
|
||||
|
||||

|
||||
**WARNING**: Kindle Scribe 2025 MOBI support is limited, converted books may have blank pages. Use PDF instead.
|
||||
|
||||
If you are on macOS and use a 2022+ Kindle, you may need to use Amazon USB File Manager for Mac or OpenMTP.
|
||||
|
||||
@@ -77,7 +81,7 @@ Installation tutorial: https://www.youtube.com/watch?v=IR2Fhcm9658
|
||||
|
||||
## Kindle Jailbreak for KOreader
|
||||
|
||||
Jailbreaking to use KOreader is optional. KCC works just fine with the native mobi manga viewer.
|
||||
Jailbreaking to use KOreader is optional. MOBI manga converted by KCC can be opened in Kindle’s native reader just fine
|
||||
|
||||
But if you jailbreak your Kindle, you'll unlock additional features like:
|
||||
|
||||
@@ -86,6 +90,10 @@ But if you jailbreak your Kindle, you'll unlock additional features like:
|
||||
2) no dependency on kindlegen, which can mean **twice as fast conversions** since you can convert to CBZ directly.
|
||||
3) You can dither by partially checking the JPG/PNG box and can crop in KCC instead of KOreader. This may increase page turn speed and battery.
|
||||
|
||||
Common KOreader manga mistakes: https://youtu.be/gaakIh9p8tw?si=X7OgPJlAvL9XGbLR
|
||||
|
||||
Set per folder setting defaults: https://youtu.be/O9p6HVWIQ6s?si=Jtx607erCBA_auWM
|
||||
|
||||
### A word of warning
|
||||
**KCC** _is not_ [Amazon's Kindle Comic Creator](http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1001103761) nor is in any way endorsed by Amazon.
|
||||
Amazon's tool is for comic publishers and involves a lot of manual effort, while **KCC** is for comic/manga readers.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 536 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 619 KiB |
@@ -1,4 +1,5 @@
|
||||
from PIL import ImageOps, ImageFilter, ImageFile
|
||||
from PIL.Image import Image
|
||||
import numpy as np
|
||||
from .common_crop import threshold_from_power, group_close_values
|
||||
|
||||
@@ -149,22 +150,39 @@ def get_bbox_crop_margin(img, power=1, background_color='white'):
|
||||
|
||||
return bw_img.getbbox()
|
||||
|
||||
def ignore_pixels_near_edge(bw_img):
|
||||
def ignore_pixels_near_edge(bw_img: Image):
|
||||
w, h = bw_img.size
|
||||
# going 0.02-0.03 was too much
|
||||
if int(0.02 * h) == int(0.025 * h):
|
||||
return
|
||||
if int(0.02 * w) == int(0.025 * w):
|
||||
return
|
||||
edge_bbox = [
|
||||
(0, 0, w, int(0.02 * h)),
|
||||
(0, int(0.98 * h), w, h),
|
||||
(0, 0, int(0.02 * w), h),
|
||||
(int(0.98 * w), 0, w, h)
|
||||
]
|
||||
for box in edge_bbox:
|
||||
edge = bw_img.crop(box)
|
||||
h = edge.histogram()
|
||||
if not edge.height or not edge.width:
|
||||
continue
|
||||
imperfections = h[255] / (edge.height * edge.width)
|
||||
if imperfections > 0 and imperfections < .02:
|
||||
bw_img.paste(im=0, box=box)
|
||||
|
||||
inner_bbox = [
|
||||
(int(0.02 * w), int(0.02 * h), int(0.98 * w), int(0.025 * h)), # top
|
||||
(int(0.02 * w), int(0.975 * h), int(0.98 * w), int(0.98 * h)), # lower
|
||||
(int(0.02 * w), int(0.02 * h), int(0.025 * w), int(0.98 * h)), # left
|
||||
(int(0.975 * w), int(0.02 * h), int(0.98 * w), int(0.98 * h)), # right
|
||||
]
|
||||
|
||||
for edge_box, inner_box in zip(edge_bbox, inner_bbox):
|
||||
inner_edge = bw_img.crop(inner_box)
|
||||
h = inner_edge.histogram()
|
||||
imperfections = h[255] / (inner_edge.height * inner_edge.width)
|
||||
|
||||
if imperfections > 0 and imperfections < .001:
|
||||
bw_img.paste(im=0, box=inner_box)
|
||||
if imperfections < .001:
|
||||
edge = bw_img.crop(edge_box)
|
||||
edge_h = edge.histogram()
|
||||
if edge_h[-1] != 0:
|
||||
bw_img.paste(im=0, box=edge_box)
|
||||
|
||||
|
||||
def box_intersect(box1, box2, max_dist):
|
||||
|
||||
Reference in New Issue
Block a user