Closed ogliznutsa closed 3 years ago
@lilith could you please comment on the issue? Is it a bug or expected behavior?
I added proper background color rendering so that transparent pngs are not corrupted when converting to jpegs.
This is probably the cause. I assume this is only happening with 32 bit but not 24 bit PNGs?
On Fri, Feb 19, 2021, 5:00 AM Oleg Gliznutsa notifications@github.com wrote:
@lilith https://github.com/lilith could you please comment on the issue? Is it a bug or expected behavior?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/imazen/imageflow/issues/576#issuecomment-782031662, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2LHZWEPT2DLVE3CL2VODS7ZHGNANCNFSM4XLGW5BQ .
@lilith Yes, 24 bit PNGs are not affected
This is the offending code: https://github.com/imazen/imageflow/blob/main/imageflow_core/src/graphics/blend.rs#L23-L43
There's no obvious way to fix the performance without sacrificing blending accuracy, so this may take a while to optimize/resolve.
Previously, transparent areas of PNGs were simply lifted to opacity with whatever random color data happened to be stored in those pixels, which caused lots of artifacts.
Thanks @lilith, sounds like the same. Would you recommend setting the background color (bgcolor) to avoid the perf cost for now?
It won't help - the default bgcolor is white.
On Mon, Mar 1, 2021, 7:53 PM Ben Waldron notifications@github.com wrote:
Thanks @lilith https://github.com/lilith, sounds like the same. Would you recommend setting the background color (bgcolor) to avoid the perf cost for now?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/imazen/imageflow/issues/576#issuecomment-788536447, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2LH3U2MJKXWEMDZKG6LTTBRHKBANCNFSM4XLGW5BQ .
I found a way to optimize it drastically. Try v1.5.6-rc60
Much appreciated, thanks!
From: Lilith River @.> Sent: Saturday, March 13, 2021 12:00:40 PM To: imazen/imageflow @.> Cc: Ben Waldron @.>; Comment @.> Subject: Re: [imazen/imageflow] Png -> jpg conversion became >10x slower at v1.5.3-rc57 (#576)
I found a way to optimize it drastically. Try v1.5.6-rc60
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/imazen/imageflow/issues/576#issuecomment-798776700, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAHPV5KPVGT5A2SDKRQI47DTDOY5RANCNFSM4XLGW5BQ.
Now works much faster, thanks @lilith !
Starting from
v1.5.3-rc57
png->jpg conversion is >10x slower.Tests.zip
Imageflow.Net
v0.7.21
+ Imageflow.NativeRuntime.win-x86_64v1.5.2-rc56
:Imageflow.Net
v0.7.21
+ Imageflow.NativeRuntime.win-x86_64v1.5.3-rc57
:imageflow-dotnet-server gets stuck when doing such conversion - when deployed to Azure App Service (B1 app plan), it takes more than 40 seconds to convert 3 png files to jpg. We temporary downgraded imageflow-dotnet-server to
v0.5.1
to use old native runtime under the hood.