Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Scaling on Decode #39

Open
GordoRank opened this issue Jul 27, 2015 · 0 comments
Open

Feature Request: Scaling on Decode #39

GordoRank opened this issue Jul 27, 2015 · 0 comments

Comments

@GordoRank
Copy link

From having a brief look through your code it looks as though it should be possible to implement basic scaling on decode in the manner in which libjpeg version 8+ does... Basically by changing the DCT block size from 8x8 to something else (1x1, 4x4, 16x16 etc) so that only the DCT coefficients necessary for the desired size are decoded, effectively scaling the image.

My suggestion is to allow the parser to to be initialized with optional width/height parameters. Obviously the output size will not always be the same as the input values but the next largest possible size for the given jpeg image.

My rationale for this is that for our particular use case we have to deal with some very large images that are only ever intended to be displayed at a far lower resolution than the source files. In which case jpg.js is just too slow to be useful and a lot of processing time is used decoding data which only gets stripped in the resize/resample process before display.

Implementing this should dramatically speed up the process in such cases

A document describing exactly what I am suggesting can be found here:

http://jpegclub.org/temp/Evolution_of_JPEG.doc

I would love to know your thoughts on the matter..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant