Gamma Correction for antialiasing

Bug #170565 reported by Carlosmerahorti
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Wishlist
Unassigned

Bug Description

Implement this:
http://home.no.net/dmaurer/~dersch/gamma/gamma.html
So images don't look badly.
Anyway, is that a good idea?

Tags: cairo color
Revision history for this message
Prokoudine (prokoudine) wrote :

Originator: NO

Carlos, sorry, but "images looking badly" is not a sufficient explanation
;-)

Inksape 0.46/SVN has color management.

http://wiki.inkscape.org/wiki/index.php/ReleaseNotes046#Color_management

Is this what you wanted?

Changed in inkscape:
importance: Undecided → Wishlist
status: New → Incomplete
Revision history for this message
Tom Davidson (tjd-mit) wrote :

Actually, the linked page has a pretty nice description of the issue. I'm not sure if the new color management code takes care of this or not...

As I understand it, the problem is that doing linear interpolation across color boundaries when doing antialiasing, even though mathematically correct, can introduce color and luminance fringes, since linear interpolation doesn't produce *perceptually* smooth gradients...

The next step in this bug would be fore someone motivated to test the new LCMS feeatures in Inkscape 0.46 to see if this is currently handled correctly. If not, some test SVG files and test PNG renders would certainly help generate developer interest...

Revision history for this message
Blender3D (blender3d) wrote :

You can classificate this issue as BUG!

http://blenderx.bl.funpic.de/inkscape/
download test svg+png files

You can see here some problems with this images (note that both rects have same 1px wide lines):
1) non rotated rectangle's rounded edges looks darker than 1px lines on the sides
2) rotated rectange looks darker than non rotated rectangle

to fix this: do a gamma-correction - theoreticaly this should be gamma 2.2 (=monitor) - but the result is not good - i tested with gamma 1.5 - and this was perfect

this test is only possible, because inkscape do "wrong linear" alpha calculation between black and white in example images...

to fix this "bug" - inkscape should do this:
1) convert colors to linear space (1/gamma = inverted gamma) - remember that you work in non-linear-space!!!
2) do alpha calculations
3) convert back to non linear space (gamma)

As you can see we need also a custom selectable gamma correction value

If you need more informations about this problem: read this great article - this describe that most graphic programs ignore gamma corrections and create wrong graphics...

http://www.4p8.com/eric.brasseur/gamma.html

Changed in inkscape:
status: Incomplete → Confirmed
Revision history for this message
Blender3D (blender3d) wrote :

i'm again... i tested with gamma 1.5 / 1.8 / 2.0 / 2.2

i can not decide what looks better

but if i look to this image from distance i think gamma 2.2 is the best
1.8 looks also better from near distance...

(but this values depends on your monitor gamma)

Revision history for this message
MenTaLguY (mental-deactivatedaccount) wrote : Re: [Bug 170565] Re: Gamma Correction for antialiasing

Which gamma looks right depends on the display color profile; this is
actually something which would need to hook into LittleCMS in some
way.

In any case, I agree that gamma-sensitive antialiasing is desirable, but
realistically this probably isn't going to be addressed until cairo
implements support for gamma corrected antialiasing and we switch to
cairo for all our rendering.

Revision history for this message
Blender3D (blender3d) wrote :

http://wiki.inkscape.org/wiki/index.php/Roadmap#Milestone_17_-_Inkscape_0.51

oh i see that cairo is planed for 0.51 - come it in 2 years? pffff

Revision history for this message
Alexandre Prokoudine (alexandre-prokoudine) wrote :

Rule №1: don't trust roadmaps. Cairo will most likely be done in 0.48.

Revision history for this message
ScislaC (scislac) wrote :

Blender3D,

Our Roadmap is very loosely followed. Sometimes we get features way before a given milestone, other times we get features later than when originally hoped for. It all depends on if someone has an itch to scratch with a given feature. Either way, Alexandre nailed it with don't trust roadmaps.

tags: added: cairo
removed: alpha gamma
Revision history for this message
Jaspervdg (jaspervdg) wrote :

I would suggest to implement the color-interpolation property and not change anti-aliasing. This way all operations concerning blending of colors can be done in linearRGB space if desired (as far as I can tell SVG does not support any other color spaces than sRGB and linearRGB for blending operations, if it does support them the same idea applies).

Revision history for this message
Blender3D (blender3d) wrote :

After a long time of 4 years (!!!)

I tested with dev Build 0.49 (that should have Cairo implemented)
The issue with alphapixels is still open.

Here is no gamma-correction, that is needed for clean output.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.