mirror of
https://github.com/ciromattia/kcc
synced 2026-10-12 12:32:32 +00:00
add no quantize option (#1269)
This commit is contained in:
@@ -272,6 +272,7 @@ PROCESSING:
|
|||||||
--coverfill Center-crop only the cover to fill target device screen
|
--coverfill Center-crop only the cover to fill target device screen
|
||||||
--forcecolor Don't convert images to grayscale
|
--forcecolor Don't convert images to grayscale
|
||||||
--forcepng Create PNG files instead JPEG
|
--forcepng Create PNG files instead JPEG
|
||||||
|
--noquantize Don't quantize PNG images to 16 colors
|
||||||
--mozjpeg Create JPEG files using mozJpeg
|
--mozjpeg Create JPEG files using mozJpeg
|
||||||
--jpeg-quality The JPEG quality, on a scale from 0 (worst) to 95 (best). Default 85 for most devices.
|
--jpeg-quality The JPEG quality, on a scale from 0 (worst) to 95 (best). Default 85 for most devices.
|
||||||
--maximizestrips Turn 1x4 strips to 2x2 strips
|
--maximizestrips Turn 1x4 strips to 2x2 strips
|
||||||
|
|||||||
+14
@@ -929,6 +929,20 @@ Higher values are larger and higher quality, and may resolve blank page issues.<
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="10" column="2">
|
||||||
|
<widget class="QCheckBox" name="noQuantizeBox">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Don't quantize PNG images to 16 colors (4 bit)
|
||||||
|
|
||||||
|
This will double file size but preserve all 256 colors (8 bit).
|
||||||
|
|
||||||
|
Eink only has 16 shades of gray so you probably don't want this.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>No Quantize</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -353,6 +353,8 @@ class WorkerThread(QThread):
|
|||||||
options.forcepng = True
|
options.forcepng = True
|
||||||
elif GUI.mozJpegBox.checkState() == Qt.CheckState.Checked:
|
elif GUI.mozJpegBox.checkState() == Qt.CheckState.Checked:
|
||||||
options.mozjpeg = True
|
options.mozjpeg = True
|
||||||
|
if GUI.noQuantizeBox.isChecked():
|
||||||
|
options.noquantize = True
|
||||||
if GUI.jpegQualityBox.isChecked():
|
if GUI.jpegQualityBox.isChecked():
|
||||||
options.jpegquality = GUI.jpegQualitySpinBox.value()
|
options.jpegquality = GUI.jpegQualitySpinBox.value()
|
||||||
if GUI.currentMode > 2:
|
if GUI.currentMode > 2:
|
||||||
@@ -1045,6 +1047,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
|||||||
'coverFillBox': GUI.coverFillBox.checkState(),
|
'coverFillBox': GUI.coverFillBox.checkState(),
|
||||||
'metadataTitleBox': GUI.metadataTitleBox.checkState(),
|
'metadataTitleBox': GUI.metadataTitleBox.checkState(),
|
||||||
'mozJpegBox': GUI.mozJpegBox.checkState(),
|
'mozJpegBox': GUI.mozJpegBox.checkState(),
|
||||||
|
'noQuantizeBox': GUI.noQuantizeBox.checkState(),
|
||||||
'jpegQualityBox': GUI.jpegQualityBox.checkState(),
|
'jpegQualityBox': GUI.jpegQualityBox.checkState(),
|
||||||
'jpegQuality': GUI.jpegQualitySpinBox.value(),
|
'jpegQuality': GUI.jpegQualitySpinBox.value(),
|
||||||
'widthBox': GUI.widthBox.value(),
|
'widthBox': GUI.widthBox.value(),
|
||||||
|
|||||||
@@ -477,6 +477,11 @@ class Ui_mainWindow(object):
|
|||||||
|
|
||||||
self.gridLayout_2.addWidget(self.rotateRightBox, 10, 1, 1, 1)
|
self.gridLayout_2.addWidget(self.rotateRightBox, 10, 1, 1, 1)
|
||||||
|
|
||||||
|
self.noQuantizeBox = QCheckBox(self.optionWidget)
|
||||||
|
self.noQuantizeBox.setObjectName(u"noQuantizeBox")
|
||||||
|
|
||||||
|
self.gridLayout_2.addWidget(self.noQuantizeBox, 10, 2, 1, 1)
|
||||||
|
|
||||||
|
|
||||||
self.gridLayout.addWidget(self.optionWidget, 5, 0, 1, 2)
|
self.gridLayout.addWidget(self.optionWidget, 5, 0, 1, 2)
|
||||||
|
|
||||||
@@ -764,6 +769,14 @@ class Ui_mainWindow(object):
|
|||||||
self.rotateRightBox.setToolTip(QCoreApplication.translate("mainWindow", u"Rotate 2 page spreads in opposite direction than normal.", None))
|
self.rotateRightBox.setToolTip(QCoreApplication.translate("mainWindow", u"Rotate 2 page spreads in opposite direction than normal.", None))
|
||||||
#endif // QT_CONFIG(tooltip)
|
#endif // QT_CONFIG(tooltip)
|
||||||
self.rotateRightBox.setText(QCoreApplication.translate("mainWindow", u"Rotate Right", None))
|
self.rotateRightBox.setText(QCoreApplication.translate("mainWindow", u"Rotate Right", None))
|
||||||
|
#if QT_CONFIG(tooltip)
|
||||||
|
self.noQuantizeBox.setToolTip(QCoreApplication.translate("mainWindow", u"Don't quantize PNG images to 16 colors (4 bit)\n"
|
||||||
|
"\n"
|
||||||
|
"This will double file size but preserve all 256 colors (8 bit).\n"
|
||||||
|
"\n"
|
||||||
|
"Eink only has 16 shades of gray so you probably don't want this.", None))
|
||||||
|
#endif // QT_CONFIG(tooltip)
|
||||||
|
self.noQuantizeBox.setText(QCoreApplication.translate("mainWindow", u"No Quantize", None))
|
||||||
self.gammaLabel.setText(QCoreApplication.translate("mainWindow", u"Gamma: Auto", None))
|
self.gammaLabel.setText(QCoreApplication.translate("mainWindow", u"Gamma: Auto", None))
|
||||||
self.jpegQualityLabel.setText(QCoreApplication.translate("mainWindow", u"JPEG Quality:", None))
|
self.jpegQualityLabel.setText(QCoreApplication.translate("mainWindow", u"JPEG Quality:", None))
|
||||||
# retranslateUi
|
# retranslateUi
|
||||||
|
|||||||
@@ -707,7 +707,8 @@ def imgFileProcessing(work):
|
|||||||
pass
|
pass
|
||||||
elif opt.forcepng:
|
elif opt.forcepng:
|
||||||
img.convertToGrayscale()
|
img.convertToGrayscale()
|
||||||
img.quantizeImage()
|
if not opt.noquantize:
|
||||||
|
img.quantizeImage()
|
||||||
if opt.format == 'PDF':
|
if opt.format == 'PDF':
|
||||||
img.convertToGrayscale()
|
img.convertToGrayscale()
|
||||||
elif opt.profile == 'KDX' and opt.format == 'CBZ':
|
elif opt.profile == 'KDX' and opt.format == 'CBZ':
|
||||||
@@ -1403,6 +1404,8 @@ def makeParser():
|
|||||||
help="Erase rainbow effect on color eink screen by attenuating interfering frequencies")
|
help="Erase rainbow effect on color eink screen by attenuating interfering frequencies")
|
||||||
processing_options.add_argument("--forcepng", action="store_true", dest="forcepng", default=False,
|
processing_options.add_argument("--forcepng", action="store_true", dest="forcepng", default=False,
|
||||||
help="Create PNG files instead JPEG")
|
help="Create PNG files instead JPEG")
|
||||||
|
processing_options.add_argument("--noquantize", action="store_true", dest="noquantize", default=False,
|
||||||
|
help="Don't quantize to 16 color PNG")
|
||||||
processing_options.add_argument("--mozjpeg", action="store_true", dest="mozjpeg", default=False,
|
processing_options.add_argument("--mozjpeg", action="store_true", dest="mozjpeg", default=False,
|
||||||
help="Create JPEG files using mozJpeg")
|
help="Create JPEG files using mozJpeg")
|
||||||
processing_options.add_argument("--jpeg-quality", type=int, dest="jpegquality",
|
processing_options.add_argument("--jpeg-quality", type=int, dest="jpegquality",
|
||||||
|
|||||||
Reference in New Issue
Block a user