WeTransfer / image_vise

Image processing proxy that works via signed URLs
Other
20 stars 5 forks source link

Fix ellipse stencil for a png with a transparent background #5

Closed dsnipe closed 7 years ago

julik commented 7 years ago

@dsnipe so I looked at this and the premult is indeed not correct. To test it I made an image from the test suite with a narrowly-traced building edges, applied a lens defocus to it and saved it as a PNG with transparency. The idea behind that operation is that if you have hard edges in your alpha channel it will mask the premultiplication issues, even though you might be doing it incorrectly. If I apply the ellipse stencil as it stands now, I get an image like this:

circle-stencil-transparent-bg

for an initial image that looks like this

waterside_magic_hour_transp

I'll play with the imagemagick options some more to find how to coerce it into submission (the rule of graphics apps is that if an application has no explicit premult controls it probably does premult... poorly - like evidenced by this example). Super thanks for your research, I'll take this further.