[Bug 64241] New: PPT2PNG - shape

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 64241] New: PPT2PNG - shape

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64241

            Bug ID: 64241
           Summary: PPT2PNG - shape
           Product: POI
           Version: unspecified
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

Created attachment 37105
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37105&action=edit
power point capture & PPT2PNG result

I've tried to export PPT as png via PPT2PNG included 4.1.2.

Font color of shape with default color rendered with whited color

here is  theme1.xml of my document.

<a:clrScheme name="Office">
  <a:dk1>
    <a:sysClr lastClr="000000" val="windowText"/>
  </a:dk1>
  ...

and clrMap of slideMaster1.xml
<p:clrMap folHlink="folHlink" hlink="hlink" accent6="accent6" accent5="accent5"
accent4="accent4" accent3="accent3" accent2="accent2" accent1="accent1"
tx2="dk2" bg2="lt2" tx1="dk1" bg1="lt1"/>
<p:sldLayoutIdLst>

and shape's description of slide?.xml

<p:txBody>
  <a:bodyPr anchor="ctr" rtlCol="0"/>
  <a:lstStyle/>
  <a:p>
    <a:pPr algn="ctr"/>
    <a:r>
      <a:rPr lang="en-US" dirty="0" altLang="ko-KR">
        <a:solidFill>
          <a:schemeClr val="tx1"/>
        </a:solidFill>
      </a:rPr>
      <a:t>Test</a:t>
    </a:r>
    <a:endParaRPr lang="ko-KR" dirty="0" altLang="en-US">
      <a:solidFill>
        <a:schemeClr val="tx1"/>
      </a:solidFill>
    </a:endParaRPr>
  </a:p>
</p:txBody>

theme1.xml define dk1 is system window color. my window color is black and
PowerPoint render shape's caption to black.
But PPT2PNG render all shapes which has tx1 clrMap to white color.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64241] PPT2PNG - shape

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64241

--- Comment #1 from wonseok <[hidden email]> ---
Created attachment 37106
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37106&action=edit
sample pptx

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64241] XSLF - Wrong scheme colors used when rendering

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64241

Andreas Beeker <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|PPT2PNG - shape             |XSLF - Wrong scheme colors
                   |                            |used when rendering
                 OS|                            |All

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64241] XSLF - Wrong scheme colors used when rendering

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64241

--- Comment #2 from Andreas Beeker <[hidden email]> ---
fixed via r1875499

I'll keep the issue open, as I might find the error in our themes.pptx [1]
(slide 8/9) rendering too.

Maybe you have an idea, where the wrong background color comes from?

[1] https://svn.apache.org/viewvc/poi/trunk/test-data/slideshow/themes.pptx

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64241] XSLF - Wrong scheme colors used when rendering

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64241

--- Comment #3 from Andreas Beeker <[hidden email]> ---
Created attachment 37114
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37114&action=edit
Examping showing the wrong background color / calculation

Simplified version which renders too bright - I guess the tint calculation is
wrong.

So POI does currently the following:

- get background definition from the master slide: ...
  <p:bg><p:bgRef idx="1001"><a:schemeClr val="bg2"/></p:bgRef></p:bg>

- map the color on the master slide:
  <p:clrMap ... bg2="lt2" />

- get the background definition from the theme:
   <a:solidFill>
      <a:schemeClr val="phClr">
         <a:tint val="88000"/>
         <a:satMod val="105000"/>
      </a:schemeClr>
   </a:solidFill>

- get the color from the theme:
  <a:lt2><a:srgbClr val="FBEEC9"/></a:lt2>

- convert the color to HSL (H in [0..360], S in [0..100], L in [0..100]):
  H = 44.39999999999998
  S = 86.20689655172413
  L = 88.6274516582489

- apply the satMod:
  S *= 1.05
  S = 90.51724137931033

- apply the tint:
  // Lum‘ = Lum * (1-tint) + (HLSMAX – HLSMAX * (1-tint)) with HLSMAX = 100
  L = L * (1-0.88) + (100 - 100*(1-0.88))
  L = 98.63529419898987

- and converting it back to RGB

... changing the tint to L=L * 0.88 + 100 - 100*0.88 looks promising

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64241] XSLF - Wrong scheme colors used when rendering

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64241

Andreas Beeker <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #4 from Andreas Beeker <[hidden email]> ---
Fixed now also the tint/shading issue via r1875522

Tint and shading are based on scRGB opposed to HSL colorspace. [1]

Currently the order of tint/shading/*mod is hard-coded in DrawPaint - this
needs probably be adapted [2] - I haven't checked how to handle HSLF records
then ... I'll open a separate issue for this, when I'll have validated that
really different values will result .. i.e. I assume that office always uses
the same order ...

The conversion logic can be also seen in .Net 4.8 code [3]

Libre office calculates the colors slightly different [4] - they use a gamma
correction of 2.3 (POI uses 2.4 mostly) and the conversion between rgb <->
scRgb <-> hsl is more likely to be rgb <-> crgb <-> hsl. Hence the colors
differs between POI and LO.


[1]
https://social.msdn.microsoft.com/Forums/office/en-US/f6d26f2c-114f-4a0d-8bca-a27442aec4d0/tint-and-shade-elements?forum=oxmlsdk

[2]
https://social.msdn.microsoft.com/Forums/en-US/f7d46b14-6c7d-460b-96c6-5625724afa27/what-order-does-office-apply-shadetinthuemodsatmodlummod-color-modifiers?forum=os_binaryfile

[3]
https://referencesource.microsoft.com/#PresentationCore/Core/CSharp/System/Windows/Media/Color.cs,1048

[4]
https://github.com/LibreOffice/core/blob/master/oox/source/drawingml/color.cxx

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]