I have a image with a transparent background and I want to copy it over another image both images are png format I've tried using boost::gil::rgba8_image_t but it still copies the transparent image with a gray background instead. this is what I've used
#include <boost/gil.hpp>
#include <boost/gil/extension/io/png.hpp>
#include <boost/gil/extension/numeric/resample.hpp>
#include <boost/gil/extension/numeric/sampler.hpp>
#include <string>
namespace bg = boost::gil;
int main() {
std::string target{"./jail.png"};
std::string picture("./example_in.png");
bg::rgba8_image_t jail;
bg::rgba8_image_t temp;
bg::read_and_convert_image(target, jail, bg::png_tag{});
bg::rgba8_image_t pic(jail.dimensions());
bg::read_and_convert_image(picture, temp, bg::png_tag{});
bg::resize_view(bg::view(temp), bg::view(pic), bg::bilinear_sampler{});
bg::copy_pixels(bg::view(jail), bg::view(pic));
bg::write_view("out.png", bg::view(pic), bg::png_tag{});
}