Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

13
  • 1
    Wow, that's an in-depth answer ^^. I'm still trying to wrap my head around the 255 - [255*(1-0.85) + x*(2*0.85-1)] part, I don't understand how you got that formula.
    – Zenoo
    Commented Feb 15, 2018 at 8:04
  • 1
    @Zenoo well i was helped with some internet search :) i worked before with image processing so i had to refresh my memory by reading few article to understand how the calculation is done and after a simplification i ended with this formula ;) Commented Feb 15, 2018 at 8:11
  • I looked at the W3C definition for the invert() filter, but I must say I still have no clue how you achieved that ^^
    – Zenoo
    Commented Feb 15, 2018 at 8:18
  • @Zenoo well if you insist :) you can see that the invert uses feComponentTransfer and you can read about this one [here] (w3.org/TR/filter-effects/#feComponentTransferElement) and if you continu reading you will end up by this feFunc* that is applied to the 3 colors using the [table type] (w3.org/TR/filter-effects/#valdef-type-table) --> with this you can have some clue ;) Commented Feb 15, 2018 at 8:33
  • 1
    @TemaniAfif Your reasoning is wrong in multiple ways, but they cancel out to arrive at the correct answer: that you can't invert an invert. The simple solution to the problem as you stated it would be to contrast(1/(1-2*p)) the image and then invert(p) the container; those two transforms compose to the identity transform. The real reason this doesn't work is that a. colors are clipped to [0..255] after each transform and b. invert always compresses the input range → the img transform (which precedes invert) has to expand the input range and therefore will run into clipping.
    – Iris Artin
    Commented Nov 16, 2021 at 4:44