Closed ajatprabha closed 5 years ago
Hey check out this PR: https://github.com/anthonynsimon/bild/pull/67
Let me know if that's what you're after.
Yes, that solves this issue. Although, image.Gray
throughs away transparency while grayscaling because there's no Alpha information. Do you have a solution on that?
I ended up with this meanwhile.
https://github.com/gojek/darkroom/blob/e1c6479f6235312b186521c7b76dd91992168d17/pkg/processor/native/processor.go#L83-L101
@ajatprabha thanks for the feedback. I modified it to now return a proper image.RGBA
instead of the single channel image.Gray
. Hope this resolves the issue!
Awesome @anthonynsimon Hope this gets merged soon.
The current implementation uses 0.3R + 0.6G + 0.1B as the heuristic which produces choppy results on certain images. I've found that 0.299R + 0.587G + 0.114B produces much better results. There should be a way to set this heuristic.