You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(image): "saturation" writes a:satMod as a child of a:blip, so nothing applies it #723
No a:grayscl anywhere in the part. Converted with LibreOffice 26.8.3.1 to PDF, the picture keeps its colours. Replacing the key with "duotone": ["#000000", "#FFFFFF"] on the same slide renders neutral grey, so the pipeline and the image are fine — only this key is.
Built at c052b173.
Where
sdpm/sdpm/utils/image.py:148-163 adds a:satMod straight to a:blip:
a:satMod is a colour transform. In ECMA-376 it is a child of a colour element (a:srgbClr, a:schemeClr, …), not of a:blip. What a:blip accepts are the blip effects — alphaBiLevel, alphaCeiling, alphaFloor, alphaInv, alphaMod, alphaModFix, alphaRepl, biLevel, blur, clrChange, clrRepl, duotone, fillOverlay, grayscl, hsl, lum, tint — and satMod is not one of them, so a renderer has nothing to apply it to.
The comment two lines above says the intent was to wrap it:
# Use satMod inside colorChange for cross-platform compatibility# (a:hsl is not reliably supported on macOS PowerPoint)
Nothing wraps it; it is appended to blip.
The key is documented in sdpm/references/guides/slide-json-media.md as saturation: saturation adjustment (-100=monochrome, 0=no change, 100=vivid), so a composer
following the guide gets silence rather than a warning.
Fix
-100 is the common case and has an exact blip effect: emit <a:grayscl/>.
Intermediate values need a decision, which is why this is not a one-line change. a:hsl is the
blip effect for them, and the comment above records that it was avoided for macOS PowerPoint. If
that still holds, the choices are to accept only -100 and warn on other values, or to
approximate with a:duotone between two greys. Whichever is chosen, the element written today
should go, because it silently does nothing.
🤖 KiroCrew automated comment (triage, not a maintainer decision)
Thanks @naohito2000 for the clear report and the pointer to the dead comment.
Confirmed on main (c43f773). A deck with "saturation": -100 writes <a:blip r:embed="rId2"><a:satMod val="0"/></a:blip>. Validating slide1.xml against the ISO/IEC 29500 pml.xsd gives exactly one error: a:satMod: This element is not expected inside CT_Blip. tests/test_image_effects.py::test_saturation_is_a_sat_mod pins the wrong element, so it needs to change with the fix.
Size: S (sdpm/sdpm/utils/image.py, the converter in converter/elements/media.py, that test).
Suggested approach:-100 → <a:grayscl/>, read back as saturation: -100. For other values, the smallest honest option is to warn or reject in lint instead of writing an element that does nothing; a:hsl can come later if someone confirms it renders on macOS PowerPoint today. The guide line in slide-json-media.md then says what is actually supported, so guide cost stays about the same.
If you are not planning to pick this up yourself, it looks like a good first issue for a new contributor: small, one file, clear before/after.
Activity
ShotaroKataoka commentedon Dec 3, 2026
🤖 KiroCrew automated comment (triage, not a maintainer decision)
Thanks @naohito2000 for the clear report and the pointer to the dead comment.
Confirmed on main (
c43f773). A deck with"saturation": -100writes<a:blip r:embed="rId2"><a:satMod val="0"/></a:blip>. Validatingslide1.xmlagainst the ISO/IEC 29500pml.xsdgives exactly one error:a:satMod: This element is not expectedinsideCT_Blip.tests/test_image_effects.py::test_saturation_is_a_sat_modpins the wrong element, so it needs to change with the fix.sdpm/sdpm/utils/image.py, the converter inconverter/elements/media.py, that test).-100→<a:grayscl/>, read back assaturation: -100. For other values, the smallest honest option is to warn or reject in lint instead of writing an element that does nothing;a:hslcan come later if someone confirms it renders on macOS PowerPoint today. The guide line inslide-json-media.mdthen says what is actually supported, so guide cost stays about the same.If you are not planning to pick this up yourself, it looks like a good first issue for a new contributor: small, one file, clear before/after.