Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Implement saving CICP to PNG.

Wolthera van Hövell tot Westerflier8924e000dbc3
diff --git a/libs/ui/kis_png_converter.cpp b/libs/ui/kis_png_converter.cpp
index 5481a9b0fd..cd23dd17b9 100644
--- a/libs/ui/kis_png_converter.cpp
+++ b/libs/ui/kis_png_converter.cpp
@@ -885,7 +885,7 @@ bool KisPNGConverter::saveDeviceToStore(const QString &filename, const QRect &im
options.interlace = false;
options.tryToSaveAsIndexed = false;
options.alpha = true;
- options.saveSRGBProfile = false;
+ options.storeColorSpaceInfo = true;
options.downsample = false;
if (dev->colorSpace()->id() != "RGBA") {
@@ -942,7 +942,7 @@ KisImportExportErrorCode KisPNGConverter::buildFile(QIODevice* iodevice, const Q
device = tmp;
}
- KIS_SAFE_ASSERT_RECOVER(!options.saveAsHDR || !options.forceSRGB) {
+ KIS_SAFE_ASSERT_RECOVER(!options.convertFloatToRec2020 || !options.forceSRGB) {
options.forceSRGB = false;
}
@@ -952,14 +952,18 @@ KisImportExportErrorCode KisPNGConverter::buildFile(QIODevice* iodevice, const Q
const KoColorProfile *dstProfile = device->colorSpace()->profile();
bool needColorTransform = false;
- if (options.saveAsHDR || options.forceSRGB || !colormodels.contains(device->colorSpace()->colorModelId().id())) {
+ if (options.convertFloatToRec2020 || options.forceSRGB || !colormodels.contains(device->colorSpace()->colorModelId().id())) {
dstModel = RGBAColorModelID.id();
dstProfile = KoColorSpaceRegistry::instance()->p709SRGBProfile();
needColorTransform = true;
- if (options.saveAsHDR) {
- dstProfile = KoColorSpaceRegistry::instance()->p2020PQProfile();
+ if (options.convertFloatToRec2020) {
+ if (options.floatingPointConversion == ConversionPolicy::ApplyPQ) {
+ dstProfile = KoColorSpaceRegistry::instance()->p2020PQProfile();
+ } else {
+ dstProfile = KoColorSpaceRegistry::instance()->p2020G10Profile();
+ }
}
}
@@ -987,7 +991,7 @@ KisImportExportErrorCode KisPNGConverter::buildFile(QIODevice* iodevice, const Q
device->convertTo(dstCs);
}
- KIS_SAFE_ASSERT_RECOVER(!options.saveAsHDR || !options.tryToSaveAsIndexed) {
+ KIS_SAFE_ASSERT_RECOVER(!options.convertFloatToRec2020 || !options.tryToSaveAsIndexed) {
options.tryToSaveAsIndexed = false;
}
@@ -1120,9 +1124,9 @@ KisImportExportErrorCode KisPNGConverter::buildFile(QIODevice* iodevice, const Q
* color management is bugged, so once you give it any incentive to start color managing an sRGB image it
* will turn, for example, a nice desaturated rusty red into bright poppy red. So this is disabled for now.
*/
- /*if (!options.saveSRGBProfile && sRGB) {
+ if (!options.storeExtraColorChunks && options.storeColorSpaceInfo && sRGB) {
png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr, PNG_sRGB_INTENT_PERCEPTUAL);
- }*/
+ }
/** TODO: Firefox still opens the image incorrectly if there is gAMA+cHRM tags
@@ -1199,18 +1203,37 @@ KisImportExportErrorCode KisPNGConverter::buildFile(QIODevice* iodevice, const Q
// Save the color profile
const KoColorProfile* colorProfile = device->colorSpace()->profile();
QByteArray colorProfileData = colorProfile->rawData();
- if (!sRGB || options.saveSRGBProfile) {
+ if (options.storeColorSpaceInfo && !(sRGB && options.storeExtraColorChunks)) {
+
+ bool wroteCICP = false;
+ if (options.writeCicpIfPossible && colorProfile->getColorPrimaries() != PRIMARIES_UNSPECIFIED && colorProfile->getTransferCharacteristics() != TRC_UNSPECIFIED
+ && colorProfile->getColorPrimaries() < 256 && colorProfile->getTransferCharacteristics() < 256) {
+ png_byte primaries = colorProfile->getColorPrimaries();
+ png_byte transfer = colorProfile->getTransferCharacteristics();
+ if (options.floatingPointConversion == ConversionPolicy::ApplyPQ) {
+ transfer = TRC_ITU_R_BT_2100_0_PQ;
+ } else if (options.floatingPointConversion == ConversionPolicy::ApplyHLG) {
+ transfer = TRC_ITU_R_BT_2100_0_HLG;
+ } else if (options.floatingPointConversion == ConversionPolicy::ApplySMPTE428) {
+ transfer = TRC_SMPTE_ST_428_1;
+ }
+ png_byte matrixCoef = 0;
+ png_byte fullRange = 1;
+ png_set_cICP(png_ptr, info_ptr, primaries, transfer, matrixCoef, fullRange);
+ wroteCICP = true;
+ }
+ if (!wroteCICP) {
#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 5
- const char *typeString = !options.saveAsHDR ? "icc" : "ITUR_2100_PQ_FULL";
+ const char *typeString = "icc";
png_set_iCCP(png_ptr, info_ptr, (png_const_charp)typeString, PNG_COMPRESSION_TYPE_BASE, (png_const_bytep)colorProfileData.constData(), colorProfileData . size());
#else
// older version of libpng has a problem with constness on the parameters
char typeStringICC[] = "icc";
- char typeStringHDR[] = "ITUR_2100_PQ_FULL";
- char *typeString = !options.saveAsHDR ? typeStringICC : typeStringHDR;
+ char *typeString = typeStringICC;
png_set_iCCP(png_ptr, info_ptr, typeString, PNG_COMPRESSION_TYPE_BASE, colorProfileData.data(), colorProfileData . size());
#endif
+ }
}
// save comments from the document information
diff --git a/libs/ui/kis_png_converter.h b/libs/ui/kis_png_converter.h
index a2090943bf..ffc5ccf4ed 100644
--- a/libs/ui/kis_png_converter.h
+++ b/libs/ui/kis_png_converter.h
@@ -11,6 +11,7 @@
#include <QColor>
+#include "KoColorTransferFunctions.h"
#include "kis_types.h"
#include "kis_global.h"
#include "kis_annotation.h"
@@ -37,11 +38,14 @@ struct KisPNGOptions {
, iptc(true)
, xmp(true)
, tryToSaveAsIndexed(true)
- , saveSRGBProfile(false)
, forceSRGB(false)
, storeMetaData(false)
, storeAuthor(false)
- , saveAsHDR(false)
+ , storeColorSpaceInfo(true)
+ , writeCicpIfPossible(false)
+ , floatingPointConversion(ConversionPolicy::KeepTheSame)
+ , convertFloatToRec2020(false)
+ , storeExtraColorChunks(false)
, transparencyFillColor(Qt::white)
, downsample(false)
{}
@@ -53,11 +57,14 @@ struct KisPNGOptions {
bool iptc;
bool xmp;
bool tryToSaveAsIndexed;
- bool saveSRGBProfile;
bool forceSRGB;
bool storeMetaData;
bool storeAuthor;
- bool saveAsHDR;
+ bool storeColorSpaceInfo;
+ bool writeCicpIfPossible;
+ ConversionPolicy floatingPointConversion;
+ bool convertFloatToRec2020;
+ bool storeExtraColorChunks;
QList<const KisMetaData::Filter*> filters;
QColor transparencyFillColor;
bool downsample; // Converts to 8 bit on export
diff --git a/plugins/impex/csv/csv_saver.cpp b/plugins/impex/csv/csv_saver.cpp
index 40f3d97067..0119169265 100644
--- a/plugins/impex/csv/csv_saver.cpp
+++ b/plugins/impex/csv/csv_saver.cpp
@@ -425,7 +425,7 @@ KisImportExportErrorCode CSVSaver::getLayer(CSVLayerRecord* layer, KisDocument*
options.compression = 8;
options.tryToSaveAsIndexed = false;
options.transparencyFillColor = QColor(0,0,0);
- options.saveSRGBProfile = true; //TVPaint can use only sRGB
+ options.storeColorSpaceInfo = true; //TVPaint can use only sRGB
options.forceSRGB = false;
KisPNGConverter kpc(exportDoc);
diff --git a/plugins/impex/png/kis_png_export.cc b/plugins/impex/png/kis_png_export.cc
index f856b8f779..a64727c0dd 100644
--- a/plugins/impex/png/kis_png_export.cc
+++ b/plugins/impex/png/kis_png_export.cc
@@ -57,12 +57,28 @@ KisImportExportErrorCode KisPNGExport::convert(KisDocument *document, QIODevice
KoColor c(KoColorSpaceRegistry::instance()->rgb8());
c.fromQColor(Qt::white);
options.transparencyFillColor = configuration->getColor("transparencyFillcolor", c).toQColor();
- options.saveSRGBProfile = configuration->getBool("saveSRGBProfile", false);
options.forceSRGB = configuration->getBool("forceSRGB", true);
options.storeAuthor = configuration->getBool("storeAuthor", false);
options.storeMetaData = configuration->getBool("storeMetaData", false);
- options.saveAsHDR = configuration->getBool("saveAsHDR", false);
options.downsample = configuration->getBool("downsample", false);
+ options.storeColorSpaceInfo = configuration->getBool("storeColorSpaceInfo", true);
+ options.writeCicpIfPossible = configuration->getBool("writeCicpIfPossible", false);
+ options.storeExtraColorChunks = configuration->getBool("storeExtraColorChunks", false);
+
+ const QString conversionOption = configuration->getString("floatingPointConversionOption", "KeepSame");
+ if (conversionOption == "Rec2100PQ") {
+ options.convertFloatToRec2020 = true;
+ options.floatingPointConversion = ConversionPolicy::ApplyPQ;
+ } else if (conversionOption == "Rec2100HLG") {
+ options.convertFloatToRec2020 = true;
+ options.floatingPointConversion = ConversionPolicy::ApplyHLG;
+ } else if (conversionOption == "ApplyPQ") {
+ options.floatingPointConversion = ConversionPolicy::ApplyPQ;
+ } else if (conversionOption == "ApplyHLG") {
+ options.floatingPointConversion = ConversionPolicy::ApplyHLG;
+ } else if (conversionOption == "ApplySMPTE428") {
+ options.floatingPointConversion = ConversionPolicy::ApplySMPTE428;
+ }
vKisAnnotationSP_it beginIt = image->beginAnnotations();
vKisAnnotationSP_it endIt = image->endAnnotations();
@@ -101,12 +117,14 @@ KisPropertiesConfigurationSP KisPNGExport::defaultConfiguration(const QByteArray
v.setValue(fill_color);
cfg->setProperty("transparencyFillcolor", v);
- cfg->setProperty("saveSRGBProfile", false);
cfg->setProperty("forceSRGB", true);
- cfg->setProperty("saveAsHDR", false);
cfg->setProperty("storeMetaData", false);
cfg->setProperty("storeAuthor", false);
cfg->setProperty("downsample", false);
+ cfg->setProperty("storeColorSpaceInfo", true);
+ cfg->setProperty("writeCicpIfPossible", false);
+ cfg->setProperty("storeExtraColorChunks", false);
+ cfg->setProperty("floatingPointConversionOption", "KeepSame");
return cfg;
}
@@ -131,8 +149,6 @@ KisWdgOptionsPNG::KisWdgOptionsPNG(QWidget *parent)
: KisConfigWidget(parent)
{
setupUi(this);
-
- connect(chkSaveAsHDR, SIGNAL(toggled(bool)), this, SLOT(slotUseHDRChanged(bool)));
}
void KisWdgOptionsPNG::setConfiguration(const KisPropertiesConfigurationSP cfg)
@@ -142,6 +158,64 @@ void KisWdgOptionsPNG::setConfiguration(const KisPropertiesConfigurationSP cfg)
KIS_SAFE_ASSERT_RECOVER_NOOP(cfg->hasProperty(KisImportExportFilter::ColorModelIDTag));
KIS_SAFE_ASSERT_RECOVER_NOOP(cfg->hasProperty(KisImportExportFilter::sRGBTag));
+ // Setup the floating point conversion options.
+ QStringList conversionOptionsList = { i18nc("Color space name", "Rec 2100 PQ"), i18nc("Color space name", "Rec 2100 HLG")};
+ QStringList toolTipList = {i18nc("@tooltip", "The image will be converted to Rec 2020 linear first, and then encoded with a perceptual quantizer curve"
+ " (also known as SMPTE 2048 curve). Recommended for HDR images where the absolute brightness is important."),
+ i18nc("@tooltip", "The image will be converted to Rec 2020 linear first, and then encoded with a Hybrid Log Gamma curve."
+ " Recommended for HDR images where the display may not understand HDR.")};
+ QStringList conversionOptionName = {"Rec2100PQ", "Rec2100HLG"};
+ int cicpPrimaries = cfg->getInt(KisImportExportFilter::CICPPrimariesTag,
+ static_cast<int>(PRIMARIES_UNSPECIFIED));
+ if (cfg->getString(KisImportExportFilter::ColorModelIDTag) == "RGBA") {
+ if (cicpPrimaries != PRIMARIES_UNSPECIFIED) {
+ conversionOptionsList << i18nc("Color space option plus transfer function name", "Keep colorants, encode PQ");
+ toolTipList << i18nc("@tooltip", "The image will be linearized first, and then encoded with a perceptual quantizer curve"
+ " (also known as the SMPTE 2048 curve). Recommended for images where the absolute brightness is important.");
+ conversionOptionName << "ApplyPQ";
+
+ conversionOptionsList << i18nc("Color space option plus transfer function name", "Keep colorants, encode HLG");
+ toolTipList << i18nc("@tooltip", "The image will be linearized first, and then encoded with a Hybrid Log Gamma curve."
+ " Recommended for images intended for screens which cannot understand PQ");
+ conversionOptionName << "ApplyHLG";
+
+ conversionOptionsList << i18nc("Color space option plus transfer function name", "Keep colorants, encode SMPTE ST 428");
+ toolTipList << i18nc("@tooltip", "The image will be linearized first, and then encoded with SMPTE ST 428."
+ " Krita always opens images like these as linear floating point, this option is there to reverse that");
+ conversionOptionName << "ApplySMPTE428";
+ }
+
+ conversionOptionsList << i18nc("Color space option", "No changes, clip");
+ toolTipList << i18nc("@tooltip", "The image will be converted plainly to 12bit integer, and values that are out of bounds are clipped, the icc profile will be embedded.");
+ conversionOptionName << "KeepSame";
+ }
+
+ cmbFloatingConversion->addItems(conversionOptionsList);
+ for (int i=0; i< toolTipList.size(); i++) {
+ cmbFloatingConversion->setItemData(i, toolTipList.at(i), Qt::ToolTipRole);
+ cmbFloatingConversion->setItemData(i, conversionOptionName.at(i), Qt::UserRole+1);
+ }
+ QString optionName =
+ cfg->getString("floatingPointConversionOption", "KeepSame");
+ if (conversionOptionName.contains(optionName)) {
+ cmbFloatingConversion->setCurrentIndex(
+ conversionOptionName.indexOf(optionName));
+ }
+ const QString colorDepthId =
+ cfg->getString(KisImportExportFilter::ColorDepthIDTag);
+ if (colorDepthId == Float16BitsColorDepthID.id()
+ || colorDepthId == Float32BitsColorDepthID.id()
+ || colorDepthId == Float64BitsColorDepthID.id()) {
+ cmbFloatingConversion->setEnabled(true);
+ } else {
+ cmbFloatingConversion->setEnabled(false);
+ }
+
+ gbSaveColorInfo->setChecked(cfg->getBool("storeColorSpaceInfo", true));
+ chkCICP->setChecked(cfg->getBool("writeCicpIfPossible", true));
+ chkExtraColorChunks->setChecked(cfg->getBool("storeExtraColorChunks", true));
+
+
const bool isThereAlpha = cfg->getBool(KisImportExportFilter::ImageContainsTransparencyTag);
alpha->setChecked(cfg->getBool("alpha", isThereAlpha));
@@ -166,17 +240,8 @@ void KisWdgOptionsPNG::setConfiguration(const KisPropertiesConfigurationSP cfg)
tryToSaveAsIndexed->setVisible(!isThereAlpha);
- //const bool sRGB = cfg->getBool(KisImportExportFilter::sRGBTag, false);
-
- //chkSRGB->setEnabled(sRGB);
- chkSRGB->setChecked(cfg->getBool("saveSRGBProfile", true));
-
- //chkForceSRGB->setEnabled(!sRGB);
chkForceSRGB->setChecked(cfg->getBool("forceSRGB", false));
- chkSaveAsHDR->setChecked(cfg->getBool("saveAsHDR", false));
- slotUseHDRChanged(chkSaveAsHDR->isChecked());
-
chkAuthor->setChecked(cfg->getBool("storeAuthor", false));
chkMetaData->setChecked(cfg->getBool("storeMetaData", false));
@@ -196,14 +261,17 @@ KisPropertiesConfigurationSP KisWdgOptionsPNG::configuration() const
bool alpha = this->alpha->isChecked();
bool interlace = interlacing->isChecked();
int compression = (int)compressionLevel->value();
- bool saveAsHDR = chkSaveAsHDR->isChecked();
- bool tryToSaveAsIndexed = !saveAsHDR && this->tryToSaveAsIndexed->isChecked();
- bool saveSRGB = !saveAsHDR && chkSRGB->isChecked();
- bool forceSRGB = !saveAsHDR && chkForceSRGB->isChecked();
+ bool tryToSaveAsIndexed = this->tryToSaveAsIndexed->isChecked();
+ bool forceSRGB = chkForceSRGB->isChecked();
bool storeAuthor = chkAuthor->isChecked();
bool storeMetaData = chkMetaData->isChecked();
bool downsample = chkDownsample->isChecked();
+ bool saveColorInfo = gbSaveColorInfo->isChecked();
+ bool saveCICP = chkCICP->isChecked();
+ bool extraColor = chkExtraColorChunks->isChecked();
+
+ QString conversionMode = cmbFloatingConversion->currentData(Qt::UserRole+1).toString();
QVariant transparencyFillcolor;
transparencyFillcolor.setValue(bnTransparencyFillColor->color());
@@ -213,12 +281,14 @@ KisPropertiesConfigurationSP KisWdgOptionsPNG::configuration() const
cfg->setProperty("compression", compression);
cfg->setProperty("interlaced", interlace);
cfg->setProperty("transparencyFillcolor", transparencyFillcolor);
- cfg->setProperty("saveAsHDR", saveAsHDR);
- cfg->setProperty("saveSRGBProfile", saveSRGB);
cfg->setProperty("forceSRGB", forceSRGB);
cfg->setProperty("storeAuthor", storeAuthor);
cfg->setProperty("storeMetaData", storeMetaData);
cfg->setProperty("downsample", downsample);
+ cfg->setProperty("storeColorSpaceInfo", saveColorInfo);
+ cfg->setProperty("writeCicpIfPossible", saveCICP);
+ cfg->setProperty("storeExtraColorChunks", extraColor);
+ cfg->setProperty("floatingPointConversionOption", conversionMode);
return cfg;
}
@@ -227,12 +297,5 @@ void KisWdgOptionsPNG::on_alpha_toggled(bool checked)
bnTransparencyFillColor->setEnabled(!checked);
}
-void KisWdgOptionsPNG::slotUseHDRChanged(bool value)
-{
- tryToSaveAsIndexed->setDisabled(value);
- chkForceSRGB->setDisabled(value);
- chkSRGB->setDisabled(value);
-}
-
#include "kis_png_export.moc"
diff --git a/plugins/impex/png/kis_png_export.h b/plugins/impex/png/kis_png_export.h
index edbbfc0e96..44640de6c8 100644
--- a/plugins/impex/png/kis_png_export.h
+++ b/plugins/impex/png/kis_png_export.h
@@ -24,7 +24,6 @@ public:
private Q_SLOTS:
void on_alpha_toggled(bool checked);
- void slotUseHDRChanged(bool value);
};
class KisPNGExport : public KisImportExportFilter
diff --git a/plugins/impex/png/kis_wdg_options_png.ui b/plugins/impex/png/kis_wdg_options_png.ui
index 207362f8aa..6a45f3a07a 100644
--- a/plugins/impex/png/kis_wdg_options_png.ui
+++ b/plugins/impex/png/kis_wdg_options_png.ui
@@ -38,18 +38,25 @@
<property name="verticalSpacing">
<number>6</number>
</property>
- <item row="12" column="0">
- <widget class="QLabel" name="label_4">
+ <item row="1" column="0" rowspan="2">
+ <widget class="QLabel" name="textLabel1">
+ <property name="toolTip">
+ <string>Note: the compression level does not change the quality of the result</string>
+ </property>
+ <property name="whatsThis">
+ <string>&lt;p&gt;Adjust the compression time. Better compression takes longer.
+&lt;br&gt;Note: the compression level does not change the quality of the result.&lt;/p&gt;</string>
+ </property>
<property name="text">
- <string>Transparent color: </string>
+ <string>Compression (Lossless): </string>
</property>
<property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTop|Qt::AlignmentFlag::AlignTrailing</set>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
- <widget class="KisDoubleSliderSpinBox" name="compressionLevel" native="true">
+ <widget class="KisDoubleSliderSpinBox" name="compressionLevel">
<property name="toolTip">
<string>Note: the compression level does not change the quality of the result</string>
</property>
@@ -59,7 +66,7 @@
</property>
</widget>
</item>
- <item row="12" column="1">
+ <item row="11" column="1">
<widget class="KisColorButton" name="bnTransparencyFillColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@@ -78,31 +85,20 @@
</property>
</widget>
</item>
- <item row="9" column="1">
- <widget class="QCheckBox" name="chkMetaData">
- <property name="toolTip">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Store information like keywords, title and subject and license, if possible.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
- </property>
+ <item row="11" column="0">
+ <widget class="QLabel" name="label_4">
<property name="text">
- <string>Store Metadata</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="textLabel3">
- <property name="whatsThis">
- <string>&lt;p&gt;Adjust the compression time. Better compression takes longer.
-&lt;br&gt;Note: the compression level does not change the quality of the result.&lt;/p&gt;</string>
+ <string>Transparent color: </string>
</property>
- <property name="text">
- <string comment="The file will save fast but will not be compressed a lot">Large file size</string>
+ <property name="alignment">
+ <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="7" column="1">
- <widget class="QCheckBox" name="chkForceSRGB">
+ <item row="10" column="1">
+ <widget class="QCheckBox" name="chkDownsample">
<property name="text">
- <string>Force convert to sRGB</string>
+ <string>Force convert to 8 bits/channel</string>
</property>
</widget>
</item>
@@ -119,100 +115,126 @@
</property>
</widget>
</item>
- <item row="4" column="1">
- <widget class="QCheckBox" name="interlacing">
+ <item row="9" column="1">
+ <widget class="QCheckBox" name="chkAuthor">
<property name="toolTip">
- <string>Use interlacing when publishing on the Internet.</string>
- </property>
- <property name="whatsThis">
- <string>&lt;p&gt;Interlacing is useful if you intend to publish your image on the Internet.&lt;br&gt;
-Enabling interlacing will cause the image to be displayed by the browser even while downloading.&lt;/p&gt;</string>
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Save author nickname and the first contact information of the author profile into the png, if possible.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
- <string>Interlacing</string>
+ <string>Sign with author data</string>
</property>
</widget>
</item>
- <item row="0" column="2">
- <widget class="QLabel" name="textLabel4_2">
+ <item row="0" column="1">
+ <widget class="QLabel" name="textLabel3">
<property name="whatsThis">
<string>&lt;p&gt;Adjust the compression time. Better compression takes longer.
&lt;br&gt;Note: the compression level does not change the quality of the result.&lt;/p&gt;</string>
</property>
<property name="text">
- <string comment="The compression will take a long time; saving the file will be slow.">Small file size</string>
+ <string comment="The file will save fast but will not be compressed a lot">Large file size</string>
</property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </widget>
+ </item>
+ <item row="7" column="1">
+ <widget class="QCheckBox" name="alpha">
+ <property name="toolTip">
+ <string>Disable to get smaller files if your image has no transparency</string>
+ </property>
+ <property name="whatsThis">
+ <string>&lt;p&gt;The Portable Network Graphics (PNG) file format allows transparency in your image to be stored by saving an alpha channel.
+You can uncheck the box if you are not using transparency and you want to make the resulting file smaller .&lt;br&gt;Always saving the alpha channel is recommended.&lt;/p&gt;</string>
+ </property>
+ <property name="text">
+ <string>Store alpha channel (transparency)</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="1">
- <widget class="QCheckBox" name="chkSaveAsHDR">
+ <widget class="QCheckBox" name="chkForceSRGB">
<property name="text">
- <string>Save as HDR image (Rec. 2020 PQ)</string>
+ <string>Force convert to sRGB</string>
</property>
</widget>
</item>
- <item row="1" column="0" rowspan="2">
- <widget class="QLabel" name="textLabel1">
- <property name="toolTip">
- <string>Note: the compression level does not change the quality of the result</string>
- </property>
+ <item row="0" column="2">
+ <widget class="QLabel" name="textLabel4_2">
<property name="whatsThis">
<string>&lt;p&gt;Adjust the compression time. Better compression takes longer.
&lt;br&gt;Note: the compression level does not change the quality of the result.&lt;/p&gt;</string>
</property>
<property name="text">
- <string>Compression (Lossless): </string>
+ <string comment="The compression will take a long time; saving the file will be slow.">Small file size</string>
</property>
<property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
+ <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
</property>
</widget>
</item>
<item row="8" column="1">
- <widget class="QCheckBox" name="alpha">
+ <widget class="QCheckBox" name="chkMetaData">
<property name="toolTip">
- <string>Disable to get smaller files if your image has no transparency</string>
- </property>
- <property name="whatsThis">
- <string>&lt;p&gt;The Portable Network Graphics (PNG) file format allows transparency in your image to be stored by saving an alpha channel.
-You can uncheck the box if you are not using transparency and you want to make the resulting file smaller .&lt;br&gt;Always saving the alpha channel is recommended.&lt;/p&gt;</string>
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Store information like keywords, title and subject and license, if possible.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
- <string>Store alpha channel (transparency)</string>
- </property>
- <property name="checked">
- <bool>true</bool>
+ <string>Store Metadata</string>
</property>
</widget>
</item>
- <item row="6" column="1">
- <widget class="QCheckBox" name="chkSRGB">
+ <item row="4" column="1">
+ <widget class="QCheckBox" name="interlacing">
<property name="toolTip">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;PNG&lt;/span&gt; files have &lt;span style=&quot; font-style:italic;&quot;&gt;two&lt;/span&gt; options to save &lt;span style=&quot; font-weight:600;&quot;&gt;sRGB&lt;/span&gt; information: as a tag or as an explicit profile. For use with in websites, &lt;span style=&quot; font-style:italic;&quot;&gt;disable&lt;/span&gt; this option. For interchange with other applications, &lt;span style=&quot; font-style:italic;&quot;&gt;enable&lt;/span&gt; this option.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
- </property>
- <property name="text">
- <string>Embed sRGB profile</string>
+ <string>Use interlacing when publishing on the Internet.</string>
</property>
- </widget>
- </item>
- <item row="10" column="1">
- <widget class="QCheckBox" name="chkAuthor">
- <property name="toolTip">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Save author nickname and the first contact information of the author profile into the png, if possible.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ <property name="whatsThis">
+ <string>&lt;p&gt;Interlacing is useful if you intend to publish your image on the Internet.&lt;br&gt;
+Enabling interlacing will cause the image to be displayed by the browser even while downloading.&lt;/p&gt;</string>
</property>
<property name="text">
- <string>Sign with author data</string>
+ <string>Interlacing</string>
</property>
</widget>
</item>
- <item row="11" column="1">
- <widget class="QCheckBox" name="chkDownsample">
- <property name="text">
- <string>Force convert to 8 bits/channel</string>
+ <item row="6" column="1">
+ <widget class="QGroupBox" name="gbSaveColorInfo">
+ <property name="title">
+ <string>Save Color Space Information</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
</property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QCheckBox" name="chkCICP">
+ <property name="text">
+ <string>Save CICP if possible</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Convert Floating Point:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="cmbFloatingConversion"/>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="chkExtraColorChunks">
+ <property name="toolTip">
+ <string>Save Chroma, Gamma and sRGB chunks in addition to ICC or CICP data</string>
+ </property>
+ <property name="text">
+ <string>Save Extra Color Chunks</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
</layout>
@@ -220,10 +242,10 @@ You can uncheck the box if you are not using transparency and you want to make t
<item row="6" column="0">
<spacer>
<property name="orientation">
- <enum>Qt::Vertical</enum>
+ <enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
- <enum>QSizePolicy::Expanding</enum>
+ <enum>QSizePolicy::Policy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>