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
Add support for WebP file format #82
Conversation
Nice! I figured webp support would be pretty easy. I guess I can scratch this off my list! |
When I noticed that one of Your tasks is too write WebP plugin it was to late to stop;) I forgot to point to sample files: http://code.google.com/speed/webp/gallery.html |
Sorry, Daniel, I'm sure Robert didn't mean to step on your toes. On the other hand, I really think that a good implementation of PSD will keep you busy the whole summer, you shouldn't be worried about this. |
Oh no, it's no problem and I agree with you. A thorough PSD plugin alone will definitely be challenging and likely take the whole summer. |
Robert, can you fill us in a little about WebP, just for our info? My cursory look at the code seems to indicate that webp is always 8 bit unsigned, and either RGB or RGBA? Is that right? How is it typically used, and what problem was it designed to solve if it seems to limited? Also, what's up with the library? You seem to take it from the external project area, but is it common enough that it will typically be found in some standard location? |
I know you asked Robert, but I might be able to answer some questions. However, libwebp provides decoding functions that convert to variants of RGB: Or, you can get Y'UV directly: The libwebp API docs are incomplete (http://code.google.com/speed/webp/docs/api.html) but the code seems to have plenty of comments. For how it's meant to be used, the FAQ explains it pretty well (it's mainly meant for use on the Web): libwebp code repository info is here: |
I think Daniel explanation is good enough. The whole decode magic is in webp library and we have the ability to choose if we want return data in RGB/RGBA/... formats. As for the library question: I'm not sure what the problem is? Cmake search for webp library in external area or in area pointed by WEBP_HOME variable (which can point to standard install location?) - I just mimic the behavior for searching HDF5 and Field3d library. ff this is not correct way of doing this I would be thankfull for any advice of how to do this right;) |
OK, so from our point of view, WebP is inherently 8 bit and either RGB or RGBA? Sounds good, then.
On May 22, 2011, at 6:08 PM, dewyatt wrote:
Larry Gritz |
The code basically LGTM, but I have a few hints/requests:
|
… of the file before decoding. The same with encoding
ok, after some fighting with rebasing the commits everything is ok now. Is the code good enough to merge it with the master? |
LGTM |
I'ts look like I don't have write access to OIIO master, so feel free to push this changes;) |
Merged. |
Here's a simple WebP reader/writer that uses Google libwebp library. For now the plugin is very naive: before decompressing an image it waits till all data will be read from file. The same with writing: before compressing an image it waits till receive all image data, then compress the image and write it to the file.