make cv::imread(..., -1) respect alpha channel in PNG images (Feature #1107)


Added by Markus Schwarzenberg almost 14 years ago. Updated over 13 years ago.


Status:Done Start date:
Priority:High Due date:
Assignee:- % Done:

0%

Category:highgui-images
Target version:-
Difficulty: Pull request:

Description

With this patch cv::imread(const string& filename, int flags)
returns a 4-channel Mat containing the alpha channel, provided

flags = -1
image(filename) is a RGBA-PNG file.

opencv-png-imload-with-alpha.diff (2.5 kB) Markus Schwarzenberg, 2011-05-31 04:53 pm


Associated revisions

Revision c65c67ef
Added by Vadim Pisarevsky over 13 years ago

preserve alpha channel in PNG, when imread(..., -1) is called (ticket #1107)

Revision 616dbd53
Added by Roman Donchenko over 11 years ago

Merge pull request #1107 from abidrahmank:master

History

Updated by Markus Schwarzenberg over 13 years ago

Side note: In the application where this patch is used the R and B color channel
are swapped when using RGBA-PNG-Files. It's OK for RGB. From the sources (highgui stuff, this patch, libpng sources) it is still not clear why this happens.

Updated by Vadim Pisarevsky over 13 years ago

thanks! your patch was integrated in r6444.

  • Status changed from Open to Done
  • (deleted custom field) set to fixed

Also available in: Atom PDF