Skip to content

Getting PixelFormat from Jpeg #1293

Discussion options

You must be logged in to vote

ImageSharp works a little differently...

The PixelFormat is imperative, i.e. determined by the generic type parameter given to Image<TPixel>. The non-generic variant currently defaults to Rgba32 but we may change that in the future as we optimize each decoder.

You can however get the original bit depth from a jpeg via PixelType property on the image. You can use the various Identify methods to get this information without fully decoding the image to should you choose to do so.

Identify and co are super, super fast so you could use them to determine the bit depth and the IImageFormat which would allow you to create optimized paths for each image format and then decode along those paths.

Replies: 3 comments 18 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by JimBobSquarePants
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
18 replies
@christian-be
Comment options

@antonfirsov
Comment options

@antonfirsov
Comment options

@christian-be
Comment options

@antonfirsov
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants