Skip to content

Commit

Permalink
use Image::alpha with ImageMagick 7
Browse files Browse the repository at this point in the history
  • Loading branch information
Karry committed May 30, 2022
1 parent cb470eb commit d2f002f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pipeline_frame_prepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,13 @@ namespace timelapse {
if (f - f1 > 0) { // for 100 % transparency, we don't have to composite
Magick::Image secondLayer = *img2;
*verboseOutput << "Blend with next image with " << (opacity * 100) << " % transparency" << endl;
//secondLayer.opacity(((double) QuantumRange) * opacity);

#if MagickLibVersion < 0x700
secondLayer.opacity(Magick::Color::scaleDoubleToQuantum(opacity));
#else
secondLayer.alpha(Magick::Color::scaleDoubleToQuantum(opacity));
#endif

blended.composite(secondLayer, 0, 0, Magick::DissolveCompositeOp);
}
//writeFrame(f, blended);
Expand Down

0 comments on commit d2f002f

Please sign in to comment.