examples/vignette.rb in rmagick-3.1.0 vs examples/vignette.rb in rmagick-3.2.0
- old
+ new
@@ -49,12 +49,12 @@
# according to the intensity of the composite image pixels. In this case, the
# black pixels outside the oval become transparent and the white pixels inside
# the oval remain opaque. Each gray pixel around the border of the oval has a
# varying level of transparency depending on how dark or light it is.
-ballerina.matte = true # Ensure the ballerina image's opacity channel is enabled.
-oval.matte = false # Force the CopyOpacityCompositeOp to use pixel intensity
+ballerina.alpha(Magick::ActivateAlphaChannel) # Ensure the ballerina image's opacity channel is enabled.
+oval.alpha(Magick::DeactivateAlphaChannel) # Force the CopyOpacityCompositeOp to use pixel intensity
# to determine how much transparency to add to the ballerina
# pixels.
ballerina = ballerina.composite(oval, CenterGravity, CopyOpacityCompositeOp)
@@ -72,7 +72,7 @@
# supports 1`level of transparency. Therefore, composite the vignette over a
# standard "checkerboard" background. The resulting image will be 100% opaque.
checkerboard = Image.read('pattern:checkerboard') { self.size = "#{ballerina.columns}x#{ballerina.rows}" }
vignette = checkerboard[0].composite(ballerina, CenterGravity, OverCompositeOp)
-vignette.display
+vignette.write('vignette.png')
exit