Replies: 1 comment 3 replies
-
Thanks for the suggestion! I was just thinking of something similar a few days ago. The current API has I am looking at overhauling the way basic image metadata is exposed after I get the remaining base set of standard codecs integrated. I'll give this some thought and see what I can come up with. |
Beta Was this translation helpful? Give feedback.
-
Hi,
Thanks for the great library!
I'm using your lib to resize images that our users upload to our web site.
The images are used as avatars and may (as I imagine) be either photos, or more of a drawn logotype kind.
Therefore I reason that "logotypes" should be compressed lossless and images lossy so I choose png as lossless output and jpeg as lossy.
While it is easy to know what encoder to use when the input content types are bmp, png, gif or jpeg, it is less easy when images are in the newer webp and heic formats that may encapsulate either lossless or lossy pictures. It would also be useful to know if the image contains animation. Therefore I'm suggesting some kind of factory method that may be used to load enough of the image to determine properties like lossless / lossy state, still or animated image and maybe some other properties like if image has indexed palette and color depth? The factory method could be used to return IEncoderOptions suited to the input
"Sketchy pseudo code" definitions
usage
MagicImageProcessor.AnalyzeChooseEncoder(myStream, "image/webp", imgProps => imgProps.IsAnimation? new GifEncoderOptions { ... } ? imgProps.Lossless ? new PngEncoderOptions {...} : new JpegEncoderOptions {...} );
I don't know if the above is something that is achievable in your current API or if you would consider it suitable for adding as a feature.
Beta Was this translation helpful? Give feedback.
All reactions