gil icon indicating copy to clipboard operation
gil copied to clipboard

Add support for WebP format?

Open striezel opened this issue 3 years ago • 5 comments
trafficstars

Is your feature request related to a problem? Please describe.

GIL does not support images in the WebP format. In my experience, this format is becoming increasingly more common as a replacement for JPEG and PNG image formats. So at least read support for that format would be really nice. :)

Describe the solution you'd like

There should be an I/O extension which can read WebP images (and possibly write such images, too). Easiest way would probably be to use the existing libwebp library to do the reading and writing. Encoding/decoding of such images in one go is possible via libwebp's API.

Questions

  • Are there any intentions to add WebP support to Boost GIL?
    • If yes: Is someone already working on such a feature? What is the best way to support the existing efforts?
    • If no: What is the suggested alternative for handling WebP with Boost GIL? Would a pull requests that adds support for WebP be welcome?

striezel avatar Mar 28 '22 00:03 striezel

Are there any intentions to add WebP support to Boost GIL?

Yes, I think it's a very good idea to support the format.

If yes: Is someone already working on such a feature?

I'm not aware of any ongoing developments for this.

What is the best way to support the existing efforts?

Since there are no ongoing efforts, the best way is to

  • look at how other formats are implemented, sources in include/boost/gil/extension/io
  • implement the I/O reader/writer for WebP
  • submit it via Pull Request for review
  • enjoy the fame and wealth ;-)

mloskot avatar Mar 28 '22 08:03 mloskot

any progress?

ssleert avatar May 04 '24 08:05 ssleert

Nope, none that I'm aware of.

mloskot avatar May 04 '24 15:05 mloskot

any progress?

No, not really. ;) I still have the intention to implement it in the future, but it is currently not one of my top priorities.

If somebody really needs this urgently, then I could probably create a first iteration within the next one or two weeks. (Given that I find some spare time to dive into this.) The first iteration will probably be just able to read WebP images and have no writing capabilities, and it will probably only support reading into rgb8_image_t and rgba8_image_t images. Also remember that the WebP format allows for animated images (like animated GIFs), but all the GIL interfaces currently assume that one file means one image only. So animated WebP images would not work either. In other words: Don't expect too much from the first implementation.

striezel avatar May 05 '24 21:05 striezel

I still have the intention to implement it in the future, but it is currently not one of my top priorities.

@striezel Thanks for the interest in working on this feature!

mloskot avatar May 10 '24 08:05 mloskot