<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>459415</bug_id>
          
          <creation_ts>2022-09-19 22:54:33 +0000</creation_ts>
          <short_desc>Krita exports weirdly huge pngs when colorspace conversion is involved</short_desc>
          <delta_ts>2022-09-20 12:58:16 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>krita</product>
          <component>File formats</component>
          <version>5.1.1</version>
          <rep_platform>Microsoft Windows</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Yu-Hsuan Lai">raincolee</reporter>
          <assigned_to name="Krita Bugs">krita-bugs-null</assigned_to>
          <cc>halla</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2154402</commentid>
    <comment_count>0</comment_count>
    <who name="Yu-Hsuan Lai">raincolee</who>
    <bug_when>2022-09-19 22:54:33 +0000</bug_when>
    <thetext>SUMMARY
The pngs exported from Krita are really huge when the .kra is in a colorspace and .png is converted to sRGB during export.


STEPS TO REPRODUCE
1. Open test.kra in Krita
2. File -&gt; Export -&gt; Save as Type: png
3. Export with default options

OBSERVED RESULT
The exported png is 2.39MB

EXPECTED RESULT
The exported png is much smaller than that. I opened the exported file in Windows&apos; built-in Photos, save a copy of it, and it&apos;s only 767KB.
If I converted the .kra in Krita and then exported it, it&apos;s about 400KB only.

SOFTWARE/OS VERSIONS
Krita Version: 5.1.1
Qt Version (compiled): 5.12.12


ADDITIONAL INFORMATION
test.kra is attached</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2154403</commentid>
    <comment_count>1</comment_count>
    <who name="Yu-Hsuan Lai">raincolee</who>
    <bug_when>2022-09-19 22:55:56 +0000</bug_when>
    <thetext>test.kra is too large to be uploaded as an attachment. please download it here: https://drive.google.com/file/d/1g3wUlCMUCokH0O2qvt-y_YnB9WOmvyvJ/view?usp=sharing</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2154471</commentid>
    <comment_count>2</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2022-09-20 07:36:28 +0000</bug_when>
    <thetext>Yes, well, Photos doesn&apos;t support 16 bit/channel PNG, which krita does support. Converting to sRGB does not drop the channel depth to 8 bit/channel.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2154552</commentid>
    <comment_count>3</comment_count>
    <who name="Yu-Hsuan Lai">raincolee</who>
    <bug_when>2022-09-20 10:42:56 +0000</bug_when>
    <thetext>(In reply to Halla Rempt from comment #2)
&gt; Yes, well, Photos doesn&apos;t support 16 bit/channel PNG, which krita does
&gt; support. Converting to sRGB does not drop the channel depth to 8 bit/channel.

Is there an option to drop it to 8bit at export?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2154555</commentid>
    <comment_count>4</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2022-09-20 10:47:33 +0000</bug_when>
    <thetext>No... You&apos;ll have to manually convert the channel depth for that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2154586</commentid>
    <comment_count>5</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2022-09-20 12:57:59 +0000</bug_when>
    <thetext>Git commit 59425a042fc3208e3e5d6101796affb7d4656d69 by Halla Rempt.
Committed on 20/09/2022 at 12:57.
Pushed by rempt into branch &apos;master&apos;.

Add an option to convert to 8 bit/channel when exporting to PNG

M  +5    -4    libs/ui/kis_png_converter.cpp
M  +2    -1    libs/ui/kis_png_converter.h
M  +6    -2    plugins/impex/png/kis_png_export.cc
M  +86   -79   plugins/impex/png/kis_wdg_options_png.ui

https://invent.kde.org/graphics/krita/commit/59425a042fc3208e3e5d6101796affb7d4656d69</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2154587</commentid>
    <comment_count>6</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2022-09-20 12:58:16 +0000</bug_when>
    <thetext>Git commit 0db7c21cae65789370386f58c762dbc96e492d06 by Halla Rempt.
Committed on 20/09/2022 at 12:58.
Pushed by rempt into branch &apos;krita/5.1&apos;.

Add an option to convert to 8 bit/channel when exporting to PNG
(cherry picked from commit 59425a042fc3208e3e5d6101796affb7d4656d69)

M  +5    -4    libs/ui/kis_png_converter.cpp
M  +2    -1    libs/ui/kis_png_converter.h
M  +6    -2    plugins/impex/png/kis_png_export.cc
M  +86   -79   plugins/impex/png/kis_wdg_options_png.ui

https://invent.kde.org/graphics/krita/commit/0db7c21cae65789370386f58c762dbc96e492d06</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>