[FFmpeg-devel] [RFC] Feeding bit masks into encoders (particularly an ICO muxer)

Michael Bradshaw mbradshaw at sorensonmedia.com
Fri Aug 3 21:45:05 CEST 2012

On Fri, Aug 3, 2012 at 1:23 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> Michael Bradshaw <mbradshaw <at> sorensonmedia.com> writes:
>> When a BMP image is put in an ICO file, it is required to
>> have an associated bitmask that specifies its transparency.
> I may misunderstand you but FFmpeg's bmp encoder puts the
> transparency information into the bmp (into the eight
> "unused" bits of RGB32), so I suspect you can use the
> information in the encoded image to produce the bitmask.

It sounds like you're understanding me correctly, however that method
isn't quite as simple/robust as it seems. IIRC, BMPs can be encoded
with: 4bit or 8bit palettes; or 16bit masked bitfields; or 24/32bit
BGR(0/A). I'd like to support more than just 24/32bit pixel BGR(0/A)
formats though, and if a pixel format with <24 bits is chosen I don't
think I could just read the alpha channel...

I could use your idea as a temporary workaround and just force opaque
masks for the other pixel formats, but I'm hoping to find a solution
that can eventually properly support the full range of ICOs.



More information about the ffmpeg-devel mailing list