From 3d4fae62d8b7b214b19cd2640e8e4972c7df44a8 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sun, 9 Feb 2025 19:10:56 -0800 Subject: [PATCH] reduce rainbow checkbox (#824) --- README.md | 1 + gui/KCC.ui | 214 +++++++++++++++------------- kindlecomicconverter/KCC_gui.py | 3 + kindlecomicconverter/KCC_rc.py | 38 ++--- kindlecomicconverter/KCC_ui.py | 199 ++++++++++++++------------ kindlecomicconverter/comic2ebook.py | 3 + kindlecomicconverter/image.py | 8 ++ 7 files changed, 250 insertions(+), 216 deletions(-) diff --git a/README.md b/README.md index 1631f91..5493776 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,7 @@ OUTPUT SETTINGS: Split output into multiple files. 0: Don't split 1: Automatic mode 2: Consider every subdirectory as separate volume [Default=0] --spreadshift Shift first page to opposite side in landscape for two page spread alignment --norotate Do not rotate double page spreads in spread splitter option. + --reducerainbow Reduce rainbow effect on color eink by slightly blurring images CUSTOM PROFILE: --customwidth CUSTOMWIDTH diff --git a/gui/KCC.ui b/gui/KCC.ui index 824fd9d..bc74053 100644 --- a/gui/KCC.ui +++ b/gui/KCC.ui @@ -37,36 +37,6 @@ 0 - - - - Delete input file(s) or directory. It's not recoverable! - - - Delete input - - - - - - - <html><head/><body><p style='white-space:pre'>Enable right-to-left reading.</p></body></html> - - - Manga mode - - - - - - - <html><head/><body><p style='white-space:pre'><span style=" font-weight:600; text-decoration: underline;">Unchecked - Automatic mode<br/></span>The output will be split automatically.</p><p style='white-space:pre'><span style=" font-weight:600; text-decoration: underline;">Checked - Volume mode<br/></span>Every subdirectory will be considered as a separate volume.</p></body></html> - - - Output split - - - @@ -80,39 +50,23 @@ - - + + - <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - JPEG<br/></span>Use JPEG files</p><p><span style=" font-weight:600; text-decoration: underline;">Indeterminate - force PNG<br/></span>Create PNG files instead JPEG</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - mozJpeg<br/></span>10-20% smaller JPEG file, with the same image quality, but processing time multiplied by 2</p></body></html> + <html><head/><body><p style='white-space:pre'>Enable right-to-left reading.</p></body></html> - JPEG/PNG/mozJpeg - - - true + Manga mode - - + + - <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - Nothing<br/></span>Images smaller than device resolution will not be resized.</p><p><span style=" font-weight:600; text-decoration: underline;">Indeterminate - Stretching<br/></span>Images smaller than device resolution will be resized. Aspect ratio will be not preserved.</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - Upscaling<br/></span>Images smaller than device resolution will be resized. Aspect ratio will be preserved.</p></body></html> + <html><head/><body><p style='white-space:pre'>Enable special parsing mode for Korean Webtoons.</p></body></html> - Stretch/Upscale - - - true - - - - - - - <html><head/><body><p style='white-space:pre'>Disable conversion to grayscale.</p></body></html> - - - Color mode + Webtoon mode @@ -129,46 +83,6 @@ - - - - <html><head/><body><p style='white-space:pre'>Disable automatic gamma correction.</p></body></html> - - - Custom gamma - - - - - - - Shift first page to opposite side in landscape for two page spread alignment - - - Spread shift - - - - - - - <html><head/><body><p style='white-space:pre'>Enable special parsing mode for Korean Webtoons.</p></body></html> - - - Webtoon mode - - - - - - - <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - 1x4<br/></span>Keep format 1x4 panels strips.</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - 2x2<br/></span>Turn 1x4 strips to 2x2 to maximize screen usage.</p></body></html> - - - 1x4 to 2x2 strips - - - @@ -182,13 +96,36 @@ - - + + - Do not rotate double page spreads in spread splitter option. + <html><head/><body><p style='white-space:pre'>Disable automatic gamma correction.</p></body></html> - No rotate + Custom gamma + + + + + + + <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - Disabled<br/></span>Disabled</p><p><span style=" font-weight:600; text-decoration: underline;">Indeterminate - Horizontal<br/></span>Crop empty horizontal lines.</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - Both<br/></span>Crop empty horizontal and vertical lines.</p></body></html> + + + Inter-panel crop + + + true + + + + + + + <html><head/><body><p style='white-space:pre'>Disable conversion to grayscale.</p></body></html> + + + Color mode @@ -215,6 +152,16 @@ + + + + <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - 1x4<br/></span>Keep format 1x4 panels strips.</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - 2x2<br/></span>Turn 1x4 strips to 2x2 to maximize screen usage.</p></body></html> + + + 1x4 to 2x2 strips + + + @@ -237,19 +184,82 @@ - - + + - <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - Disabled<br/></span>Disabled</p><p><span style=" font-weight:600; text-decoration: underline;">Indeterminate - Horizontal<br/></span>Crop empty horizontal lines.</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - Both<br/></span>Crop empty horizontal and vertical lines.</p></body></html> + Delete input file(s) or directory. It's not recoverable! - Inter-panel crop + Delete input + + + + + + + <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - JPEG<br/></span>Use JPEG files</p><p><span style=" font-weight:600; text-decoration: underline;">Indeterminate - force PNG<br/></span>Create PNG files instead JPEG</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - mozJpeg<br/></span>10-20% smaller JPEG file, with the same image quality, but processing time multiplied by 2</p></body></html> + + + JPEG/PNG/mozJpeg true + + + + Shift first page to opposite side in landscape for two page spread alignment + + + Spread shift + + + + + + + <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Unchecked - Nothing<br/></span>Images smaller than device resolution will not be resized.</p><p><span style=" font-weight:600; text-decoration: underline;">Indeterminate - Stretching<br/></span>Images smaller than device resolution will be resized. Aspect ratio will be not preserved.</p><p><span style=" font-weight:600; text-decoration: underline;">Checked - Upscaling<br/></span>Images smaller than device resolution will be resized. Aspect ratio will be preserved.</p></body></html> + + + Stretch/Upscale + + + true + + + + + + + <html><head/><body><p style='white-space:pre'><span style=" font-weight:600; text-decoration: underline;">Unchecked - Automatic mode<br/></span>The output will be split automatically.</p><p style='white-space:pre'><span style=" font-weight:600; text-decoration: underline;">Checked - Volume mode<br/></span>Every subdirectory will be considered as a separate volume.</p></body></html> + + + Output split + + + + + + + Do not rotate double page spreads in spread splitter option. + + + No rotate + + + + + + + Reduce rainbow effect on color eink by slightly blurring images + + + Reduce Rainbow + + + diff --git a/kindlecomicconverter/KCC_gui.py b/kindlecomicconverter/KCC_gui.py index da835a9..ee874dd 100644 --- a/kindlecomicconverter/KCC_gui.py +++ b/kindlecomicconverter/KCC_gui.py @@ -253,6 +253,8 @@ class WorkerThread(QThread): options.batchsplit = 2 if GUI.colorBox.isChecked(): options.forcecolor = True + if GUI.reduceRainbowBox.isChecked(): + options.reducerainbow = True if GUI.maximizeStrips.isChecked(): options.maximizestrips = True if GUI.disableProcessingBox.isChecked(): @@ -796,6 +798,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow): 'webtoonBox': GUI.webtoonBox.checkState().value, 'outputSplit': GUI.outputSplit.checkState().value, 'colorBox': GUI.colorBox.checkState().value, + 'reduceRainbowBox': GUI.reduceRainbowBox.checkState().value, 'disableProcessingBox': GUI.disableProcessingBox.checkState().value, 'mozJpegBox': GUI.mozJpegBox.checkState().value, 'widthBox': GUI.widthBox.value(), diff --git a/kindlecomicconverter/KCC_rc.py b/kindlecomicconverter/KCC_rc.py index e9df7f8..0ff47f4 100644 --- a/kindlecomicconverter/KCC_rc.py +++ b/kindlecomicconverter/KCC_rc.py @@ -11612,51 +11612,51 @@ qt_resource_struct = b"\ \x00\x00\x00X\x00\x02\x00\x00\x00\x04\x00\x00\x00\x07\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x01\xc0\x00\x00\x00\x00\x00\x01\x00\x02.\xed\ -\x00\x00\x01\x90(\xef\xc4\x03\ +\x00\x00\x01\x88;p\xbcB\ \x00\x00\x01\xfe\x00\x00\x00\x00\x00\x01\x00\x02\x83\x87\ -\x00\x00\x01\x90(\xef\xc4\x00\ +\x00\x00\x01\x88;p\xbcB\ \x00\x00\x01\xea\x00\x00\x00\x00\x00\x01\x00\x02Y\x8c\ -\x00\x00\x01\x90(\xef\xc3\xff\ +\x00\x00\x01\x88;p\xbcB\ \x00\x00\x01\xd6\x00\x00\x00\x00\x00\x01\x00\x02N)\ -\x00\x00\x01\x90(\xef\xc4\x01\ +\x00\x00\x01\x89\x89D9.\ \x00\x00\x00X\x00\x02\x00\x00\x00\x04\x00\x00\x00\x0c\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\xa6\x00\x00\x00\x00\x00\x01\x00\x01(\x97\ -\x00\x00\x01\x90(\xef\xc4\x03\ +\x00\x00\x01\x88;p\xbcB\ \x00\x00\x00\xbc\x00\x00\x00\x00\x00\x01\x00\x011\xef\ -\x00\x00\x01\x94o>\xe74\ +\x00\x00\x01\x94\x1a\xa2\xa2\x92\ \x00\x00\x00\x8c\x00\x00\x00\x00\x00\x01\x00\x01\x1d\x90\ -\x00\x00\x01\x90(\xef\xc4\x02\ +\x00\x00\x01\x88;p\xbcB\ \x00\x00\x00\xd0\x00\x00\x00\x00\x00\x01\x00\x01:\x05\ -\x00\x00\x01\x90(\xef\xc4\x04\ +\x00\x00\x01\x88;p\xbcB\ \x00\x00\x00X\x00\x02\x00\x00\x00\x03\x00\x00\x00\x11\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x02B\x00\x00\x00\x00\x00\x01\x00\x02\xb5\xd3\ -\x00\x00\x01\x90(\xef\xc4!\ +\x00\x00\x01\x88;p\xbcJ\ \x00\x00\x02\x14\x00\x00\x00\x00\x00\x01\x00\x02\x9f\xd6\ -\x00\x00\x01\x90(\xef\xc4\x1d\ +\x00\x00\x01\x88;p\xbcI\ \x00\x00\x02*\x00\x00\x00\x00\x00\x01\x00\x02\xa93\ -\x00\x00\x01\x90(\xef\xc4\x19\ +\x00\x00\x01\x88;p\xbcI\ \x00\x00\x00X\x00\x02\x00\x00\x00\x07\x00\x00\x00\x15\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x01\x1c\x00\x00\x00\x00\x00\x01\x00\x01P\xb1\ -\x00\x00\x01\x90(\xef\xc4\x22\ +\x00\x00\x01\x88;p\xbcJ\ \x00\x00\x012\x00\x00\x00\x00\x00\x01\x00\x01yY\ -\x00\x00\x01\x90(\xef\xc4\x1c\ +\x00\x00\x01\x88;p\xbcI\ \x00\x00\x01\x94\x00\x00\x00\x00\x00\x01\x00\x01\xd2-\ -\x00\x00\x01\x90(\xef\xc4\x1e\ +\x00\x00\x01\x94\xb4\xd4\xf0a\ \x00\x00\x01z\x00\x00\x00\x00\x00\x01\x00\x01\x8c\xe6\ -\x00\x00\x01\x90(\xef\xc4\x18\ +\x00\x00\x01\x88;p\xbcH\ \x00\x00\x01\x04\x00\x00\x00\x00\x00\x01\x00\x01LR\ -\x00\x00\x01\x90(\xef\xc4\x0e\ +\x00\x00\x01\x88;p\xbcF\ \x00\x00\x00\xe8\x00\x00\x00\x00\x00\x01\x00\x01?\xe9\ -\x00\x00\x01\x90(\xef\xc4\x17\ +\x00\x00\x01\x88;p\xbcH\ \x00\x00\x01T\x00\x00\x00\x00\x00\x01\x00\x01\x82\xb0\ -\x00\x00\x01\x90(\xef\xc4\x18\ +\x00\x00\x01\x88;p\xbcH\ \x00\x00\x00X\x00\x02\x00\x00\x00\x01\x00\x00\x00\x1d\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00h\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x01\x90(\xef\xc4\x16\ +\x00\x00\x01\x88;p\xbcH\ " def qInitResources(): diff --git a/kindlecomicconverter/KCC_ui.py b/kindlecomicconverter/KCC_ui.py index 7a9285b..dd8e336 100644 --- a/kindlecomicconverter/KCC_ui.py +++ b/kindlecomicconverter/KCC_ui.py @@ -40,43 +40,21 @@ class Ui_mainWindow(object): self.gridLayout_2 = QGridLayout(self.optionWidget) self.gridLayout_2.setObjectName(u"gridLayout_2") self.gridLayout_2.setContentsMargins(0, 0, 0, 0) - self.deleteBox = QCheckBox(self.optionWidget) - self.deleteBox.setObjectName(u"deleteBox") - - self.gridLayout_2.addWidget(self.deleteBox, 5, 1, 1, 1) - - self.mangaBox = QCheckBox(self.optionWidget) - self.mangaBox.setObjectName(u"mangaBox") - - self.gridLayout_2.addWidget(self.mangaBox, 1, 0, 1, 1) - - self.outputSplit = QCheckBox(self.optionWidget) - self.outputSplit.setObjectName(u"outputSplit") - - self.gridLayout_2.addWidget(self.outputSplit, 3, 1, 1, 1) - self.croppingBox = QCheckBox(self.optionWidget) self.croppingBox.setObjectName(u"croppingBox") self.croppingBox.setTristate(True) self.gridLayout_2.addWidget(self.croppingBox, 4, 2, 1, 1) - self.mozJpegBox = QCheckBox(self.optionWidget) - self.mozJpegBox.setObjectName(u"mozJpegBox") - self.mozJpegBox.setTristate(True) + self.mangaBox = QCheckBox(self.optionWidget) + self.mangaBox.setObjectName(u"mangaBox") - self.gridLayout_2.addWidget(self.mozJpegBox, 4, 0, 1, 1) + self.gridLayout_2.addWidget(self.mangaBox, 1, 0, 1, 1) - self.upscaleBox = QCheckBox(self.optionWidget) - self.upscaleBox.setObjectName(u"upscaleBox") - self.upscaleBox.setTristate(True) + self.webtoonBox = QCheckBox(self.optionWidget) + self.webtoonBox.setObjectName(u"webtoonBox") - self.gridLayout_2.addWidget(self.upscaleBox, 2, 1, 1, 1) - - self.colorBox = QCheckBox(self.optionWidget) - self.colorBox.setObjectName(u"colorBox") - - self.gridLayout_2.addWidget(self.colorBox, 3, 2, 1, 1) + self.gridLayout_2.addWidget(self.webtoonBox, 2, 0, 1, 1) self.rotateBox = QCheckBox(self.optionWidget) self.rotateBox.setObjectName(u"rotateBox") @@ -84,36 +62,27 @@ class Ui_mainWindow(object): self.gridLayout_2.addWidget(self.rotateBox, 1, 1, 1, 1) - self.gammaBox = QCheckBox(self.optionWidget) - self.gammaBox.setObjectName(u"gammaBox") - - self.gridLayout_2.addWidget(self.gammaBox, 2, 2, 1, 1) - - self.spreadShiftBox = QCheckBox(self.optionWidget) - self.spreadShiftBox.setObjectName(u"spreadShiftBox") - - self.gridLayout_2.addWidget(self.spreadShiftBox, 5, 0, 1, 1) - - self.webtoonBox = QCheckBox(self.optionWidget) - self.webtoonBox.setObjectName(u"webtoonBox") - - self.gridLayout_2.addWidget(self.webtoonBox, 2, 0, 1, 1) - - self.maximizeStrips = QCheckBox(self.optionWidget) - self.maximizeStrips.setObjectName(u"maximizeStrips") - - self.gridLayout_2.addWidget(self.maximizeStrips, 4, 1, 1, 1) - self.borderBox = QCheckBox(self.optionWidget) self.borderBox.setObjectName(u"borderBox") self.borderBox.setTristate(True) self.gridLayout_2.addWidget(self.borderBox, 3, 0, 1, 1) - self.noRotateBox = QCheckBox(self.optionWidget) - self.noRotateBox.setObjectName(u"noRotateBox") + self.gammaBox = QCheckBox(self.optionWidget) + self.gammaBox.setObjectName(u"gammaBox") - self.gridLayout_2.addWidget(self.noRotateBox, 6, 1, 1, 1) + self.gridLayout_2.addWidget(self.gammaBox, 2, 2, 1, 1) + + self.interPanelCropBox = QCheckBox(self.optionWidget) + self.interPanelCropBox.setObjectName(u"interPanelCropBox") + self.interPanelCropBox.setTristate(True) + + self.gridLayout_2.addWidget(self.interPanelCropBox, 6, 2, 1, 1) + + self.colorBox = QCheckBox(self.optionWidget) + self.colorBox.setObjectName(u"colorBox") + + self.gridLayout_2.addWidget(self.colorBox, 3, 2, 1, 1) self.qualityBox = QCheckBox(self.optionWidget) self.qualityBox.setObjectName(u"qualityBox") @@ -126,6 +95,11 @@ class Ui_mainWindow(object): self.gridLayout_2.addWidget(self.disableProcessingBox, 5, 2, 1, 1) + self.maximizeStrips = QCheckBox(self.optionWidget) + self.maximizeStrips.setObjectName(u"maximizeStrips") + + self.gridLayout_2.addWidget(self.maximizeStrips, 4, 1, 1, 1) + self.authorEdit = QLineEdit(self.optionWidget) self.authorEdit.setObjectName(u"authorEdit") sizePolicy = QSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Fixed) @@ -138,11 +112,42 @@ class Ui_mainWindow(object): self.gridLayout_2.addWidget(self.authorEdit, 0, 0, 1, 1) - self.interPanelCropBox = QCheckBox(self.optionWidget) - self.interPanelCropBox.setObjectName(u"interPanelCropBox") - self.interPanelCropBox.setTristate(True) + self.deleteBox = QCheckBox(self.optionWidget) + self.deleteBox.setObjectName(u"deleteBox") - self.gridLayout_2.addWidget(self.interPanelCropBox, 6, 2, 1, 1) + self.gridLayout_2.addWidget(self.deleteBox, 5, 1, 1, 1) + + self.mozJpegBox = QCheckBox(self.optionWidget) + self.mozJpegBox.setObjectName(u"mozJpegBox") + self.mozJpegBox.setTristate(True) + + self.gridLayout_2.addWidget(self.mozJpegBox, 4, 0, 1, 1) + + self.spreadShiftBox = QCheckBox(self.optionWidget) + self.spreadShiftBox.setObjectName(u"spreadShiftBox") + + self.gridLayout_2.addWidget(self.spreadShiftBox, 5, 0, 1, 1) + + self.upscaleBox = QCheckBox(self.optionWidget) + self.upscaleBox.setObjectName(u"upscaleBox") + self.upscaleBox.setTristate(True) + + self.gridLayout_2.addWidget(self.upscaleBox, 2, 1, 1, 1) + + self.outputSplit = QCheckBox(self.optionWidget) + self.outputSplit.setObjectName(u"outputSplit") + + self.gridLayout_2.addWidget(self.outputSplit, 3, 1, 1, 1) + + self.noRotateBox = QCheckBox(self.optionWidget) + self.noRotateBox.setObjectName(u"noRotateBox") + + self.gridLayout_2.addWidget(self.noRotateBox, 6, 1, 1, 1) + + self.reduceRainbowBox = QCheckBox(self.optionWidget) + self.reduceRainbowBox.setObjectName(u"reduceRainbowBox") + + self.gridLayout_2.addWidget(self.reduceRainbowBox, 7, 2, 1, 1) self.gridLayout.addWidget(self.optionWidget, 5, 0, 1, 2) @@ -383,61 +388,37 @@ class Ui_mainWindow(object): def retranslateUi(self, mainWindow): mainWindow.setWindowTitle(QCoreApplication.translate("mainWindow", u"Kindle Comic Converter", None)) #if QT_CONFIG(tooltip) - self.deleteBox.setToolTip(QCoreApplication.translate("mainWindow", u"Delete input file(s) or directory. It's not recoverable!", None)) + self.croppingBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - Disabled

Disabled

Indeterminate - Margins
Margins

Checked - Margins + page numbers
Margins +page numbers

", None)) #endif // QT_CONFIG(tooltip) - self.deleteBox.setText(QCoreApplication.translate("mainWindow", u"Delete input", None)) + self.croppingBox.setText(QCoreApplication.translate("mainWindow", u"Cropping mode", None)) #if QT_CONFIG(tooltip) self.mangaBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Enable right-to-left reading.

", None)) #endif // QT_CONFIG(tooltip) self.mangaBox.setText(QCoreApplication.translate("mainWindow", u"Manga mode", None)) #if QT_CONFIG(tooltip) - self.outputSplit.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - Automatic mode
The output will be split automatically.

Checked - Volume mode
Every subdirectory will be considered as a separate volume.

", None)) + self.webtoonBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Enable special parsing mode for Korean Webtoons.

", None)) #endif // QT_CONFIG(tooltip) - self.outputSplit.setText(QCoreApplication.translate("mainWindow", u"Output split", None)) -#if QT_CONFIG(tooltip) - self.croppingBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - Disabled

Disabled

Indeterminate - Margins
Margins

Checked - Margins + page numbers
Margins +page numbers

", None)) -#endif // QT_CONFIG(tooltip) - self.croppingBox.setText(QCoreApplication.translate("mainWindow", u"Cropping mode", None)) -#if QT_CONFIG(tooltip) - self.mozJpegBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - JPEG
Use JPEG files

Indeterminate - force PNG
Create PNG files instead JPEG

Checked - mozJpeg
10-20% smaller JPEG file, with the same image quality, but processing time multiplied by 2

", None)) -#endif // QT_CONFIG(tooltip) - self.mozJpegBox.setText(QCoreApplication.translate("mainWindow", u"JPEG/PNG/mozJpeg", None)) -#if QT_CONFIG(tooltip) - self.upscaleBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - Nothing
Images smaller than device resolution will not be resized.

Indeterminate - Stretching
Images smaller than device resolution will be resized. Aspect ratio will be not preserved.

Checked - Upscaling
Images smaller than device resolution will be resized. Aspect ratio will be preserved.

", None)) -#endif // QT_CONFIG(tooltip) - self.upscaleBox.setText(QCoreApplication.translate("mainWindow", u"Stretch/Upscale", None)) -#if QT_CONFIG(tooltip) - self.colorBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Disable conversion to grayscale.

", None)) -#endif // QT_CONFIG(tooltip) - self.colorBox.setText(QCoreApplication.translate("mainWindow", u"Color mode", None)) + self.webtoonBox.setText(QCoreApplication.translate("mainWindow", u"Webtoon mode", None)) #if QT_CONFIG(tooltip) self.rotateBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - Split
Double page spreads will be cut into two separate pages.

Indeterminate - Rotate and split
Double page spreads will be displayed twice. First rotated and then split.

Checked - Rotate
Double page spreads will be rotated.

", None)) #endif // QT_CONFIG(tooltip) self.rotateBox.setText(QCoreApplication.translate("mainWindow", u"Spread splitter", None)) -#if QT_CONFIG(tooltip) - self.gammaBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Disable automatic gamma correction.

", None)) -#endif // QT_CONFIG(tooltip) - self.gammaBox.setText(QCoreApplication.translate("mainWindow", u"Custom gamma", None)) -#if QT_CONFIG(tooltip) - self.spreadShiftBox.setToolTip(QCoreApplication.translate("mainWindow", u"Shift first page to opposite side in landscape for two page spread alignment", None)) -#endif // QT_CONFIG(tooltip) - self.spreadShiftBox.setText(QCoreApplication.translate("mainWindow", u"Spread shift", None)) -#if QT_CONFIG(tooltip) - self.webtoonBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Enable special parsing mode for Korean Webtoons.

", None)) -#endif // QT_CONFIG(tooltip) - self.webtoonBox.setText(QCoreApplication.translate("mainWindow", u"Webtoon mode", None)) -#if QT_CONFIG(tooltip) - self.maximizeStrips.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - 1x4
Keep format 1x4 panels strips.

Checked - 2x2
Turn 1x4 strips to 2x2 to maximize screen usage.

", None)) -#endif // QT_CONFIG(tooltip) - self.maximizeStrips.setText(QCoreApplication.translate("mainWindow", u"1x4 to 2x2 strips", None)) #if QT_CONFIG(tooltip) self.borderBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - Autodetection
The color of margins fill will be detected automatically.

Indeterminate - White
Margins will be filled with white color.

Checked - Black
Margins will be filled with black color.

", None)) #endif // QT_CONFIG(tooltip) self.borderBox.setText(QCoreApplication.translate("mainWindow", u"W/B margins", None)) #if QT_CONFIG(tooltip) - self.noRotateBox.setToolTip(QCoreApplication.translate("mainWindow", u"Do not rotate double page spreads in spread splitter option.", None)) + self.gammaBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Disable automatic gamma correction.

", None)) #endif // QT_CONFIG(tooltip) - self.noRotateBox.setText(QCoreApplication.translate("mainWindow", u"No rotate", None)) + self.gammaBox.setText(QCoreApplication.translate("mainWindow", u"Custom gamma", None)) +#if QT_CONFIG(tooltip) + self.interPanelCropBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - Disabled
Disabled

Indeterminate - Horizontal
Crop empty horizontal lines.

Checked - Both
Crop empty horizontal and vertical lines.

", None)) +#endif // QT_CONFIG(tooltip) + self.interPanelCropBox.setText(QCoreApplication.translate("mainWindow", u"Inter-panel crop", None)) +#if QT_CONFIG(tooltip) + self.colorBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Disable conversion to grayscale.

", None)) +#endif // QT_CONFIG(tooltip) + self.colorBox.setText(QCoreApplication.translate("mainWindow", u"Color mode", None)) #if QT_CONFIG(tooltip) self.qualityBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - 4 panels
Zoom each corner separately.

Indeterminate - 2 panels
Zoom only the top and bottom of the page.

Checked - 4 high-quality panels
Zoom each corner separately. Try to increase the quality of magnification. Check wiki for more details.

", None)) #endif // QT_CONFIG(tooltip) @@ -446,14 +427,42 @@ class Ui_mainWindow(object): self.disableProcessingBox.setToolTip(QCoreApplication.translate("mainWindow", u"
Do not process any image, ignore profile and processing options
", None)) #endif // QT_CONFIG(tooltip) self.disableProcessingBox.setText(QCoreApplication.translate("mainWindow", u"Disable processing", None)) +#if QT_CONFIG(tooltip) + self.maximizeStrips.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - 1x4
Keep format 1x4 panels strips.

Checked - 2x2
Turn 1x4 strips to 2x2 to maximize screen usage.

", None)) +#endif // QT_CONFIG(tooltip) + self.maximizeStrips.setText(QCoreApplication.translate("mainWindow", u"1x4 to 2x2 strips", None)) #if QT_CONFIG(tooltip) self.authorEdit.setToolTip(QCoreApplication.translate("mainWindow", u"Default Author is KCC", None)) #endif // QT_CONFIG(tooltip) self.authorEdit.setPlaceholderText(QCoreApplication.translate("mainWindow", u"Default Author", None)) #if QT_CONFIG(tooltip) - self.interPanelCropBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - Disabled
Disabled

Indeterminate - Horizontal
Crop empty horizontal lines.

Checked - Both
Crop empty horizontal and vertical lines.

", None)) + self.deleteBox.setToolTip(QCoreApplication.translate("mainWindow", u"Delete input file(s) or directory. It's not recoverable!", None)) #endif // QT_CONFIG(tooltip) - self.interPanelCropBox.setText(QCoreApplication.translate("mainWindow", u"Inter-panel crop", None)) + self.deleteBox.setText(QCoreApplication.translate("mainWindow", u"Delete input", None)) +#if QT_CONFIG(tooltip) + self.mozJpegBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - JPEG
Use JPEG files

Indeterminate - force PNG
Create PNG files instead JPEG

Checked - mozJpeg
10-20% smaller JPEG file, with the same image quality, but processing time multiplied by 2

", None)) +#endif // QT_CONFIG(tooltip) + self.mozJpegBox.setText(QCoreApplication.translate("mainWindow", u"JPEG/PNG/mozJpeg", None)) +#if QT_CONFIG(tooltip) + self.spreadShiftBox.setToolTip(QCoreApplication.translate("mainWindow", u"Shift first page to opposite side in landscape for two page spread alignment", None)) +#endif // QT_CONFIG(tooltip) + self.spreadShiftBox.setText(QCoreApplication.translate("mainWindow", u"Spread shift", None)) +#if QT_CONFIG(tooltip) + self.upscaleBox.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - Nothing
Images smaller than device resolution will not be resized.

Indeterminate - Stretching
Images smaller than device resolution will be resized. Aspect ratio will be not preserved.

Checked - Upscaling
Images smaller than device resolution will be resized. Aspect ratio will be preserved.

", None)) +#endif // QT_CONFIG(tooltip) + self.upscaleBox.setText(QCoreApplication.translate("mainWindow", u"Stretch/Upscale", None)) +#if QT_CONFIG(tooltip) + self.outputSplit.setToolTip(QCoreApplication.translate("mainWindow", u"

Unchecked - Automatic mode
The output will be split automatically.

Checked - Volume mode
Every subdirectory will be considered as a separate volume.

", None)) +#endif // QT_CONFIG(tooltip) + self.outputSplit.setText(QCoreApplication.translate("mainWindow", u"Output split", None)) +#if QT_CONFIG(tooltip) + self.noRotateBox.setToolTip(QCoreApplication.translate("mainWindow", u"Do not rotate double page spreads in spread splitter option.", None)) +#endif // QT_CONFIG(tooltip) + self.noRotateBox.setText(QCoreApplication.translate("mainWindow", u"No rotate", None)) +#if QT_CONFIG(tooltip) + self.reduceRainbowBox.setToolTip(QCoreApplication.translate("mainWindow", u"Reduce rainbow effect on color eink by slightly blurring images", None)) +#endif // QT_CONFIG(tooltip) + self.reduceRainbowBox.setText(QCoreApplication.translate("mainWindow", u"Reduce Rainbow", None)) self.gammaLabel.setText(QCoreApplication.translate("mainWindow", u"Gamma: Auto", None)) self.croppingPowerLabel.setText(QCoreApplication.translate("mainWindow", u"Cropping power:", None)) #if QT_CONFIG(tooltip) diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index 3f031f6..60b61a3 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -616,6 +616,7 @@ def imgFileProcessing(work): img.cropInterPanelEmptySections("horizontal" if opt.interpanelcrop == 1 else "both") img.autocontrastImage() img.resizeImage() + img.optimizeForDisplay(opt.reducerainbow) if opt.forcepng and not opt.forcecolor: img.quantizeImage() output.append(img.saveToDir()) @@ -1037,6 +1038,8 @@ def makeParser(): help="Disable autodetection and force white borders") processing_options.add_argument("--forcecolor", action="store_true", dest="forcecolor", default=False, help="Don't convert images to grayscale") + output_options.add_argument("--reducerainbow", action="store_true", dest="reducerainbow", default=False, + help="Reduce rainbow effect on color eink by slightly blurring images.") processing_options.add_argument("--forcepng", action="store_true", dest="forcepng", default=False, help="Create PNG files instead JPEG") processing_options.add_argument("--mozjpeg", action="store_true", dest="mozjpeg", default=False, diff --git a/kindlecomicconverter/image.py b/kindlecomicconverter/image.py index 171a0ea..91d0a8a 100755 --- a/kindlecomicconverter/image.py +++ b/kindlecomicconverter/image.py @@ -341,6 +341,14 @@ class ComicPage: # Quantize is deprecated but new function call it internally anyway... self.image = self.image.quantize(palette=palImg) + def optimizeForDisplay(self, reducerainbow): + # Reduce rainbow artifacts for grayscale images by breaking up dither patterns that cause Moire interference with color filter array + if reducerainbow and not self.color: + unsharpFilter = ImageFilter.UnsharpMask(radius=1, percent=100) + self.image = self.image.filter(unsharpFilter) + self.image = self.image.filter(ImageFilter.BoxBlur(1.0)) + self.image = self.image.filter(unsharpFilter) + def resizeImage(self): # kindle scribe conversion to mobi is limited in resolution by kindlegen, same with send to kindle and epub if self.kindle_scribe_azw3: