examples/vignette.rb in rmagick-2.16.0 vs examples/vignette.rb in rmagick-3.0.0
- old
+ new
@@ -26,17 +26,17 @@
# become more or less transparent depending on how dark or light the pixel is.
# The size of the oval is arbitrary - in this case it's 90% of the
# size of the image.
-oval = Image.new(ballerina.columns, ballerina.rows) {self.background_color = 'black'}
+oval = Image.new(ballerina.columns, ballerina.rows) { self.background_color = 'black' }
gc = Draw.new
gc.stroke('white')
gc.fill('white')
-gc.ellipse(ballerina.columns/2, ballerina.rows/2,
- ballerina.columns/2-(ballerina.columns*0.10),
- ballerina.rows/2-(ballerina.rows*0.10), 0, 360)
+gc.ellipse(ballerina.columns / 2, ballerina.rows / 2,
+ ballerina.columns / 2 - (ballerina.columns * 0.10),
+ ballerina.rows / 2 - (ballerina.rows * 0.10), 0, 360)
gc.draw(oval)
# Add a lot of blurring to the oval. I use blur_image because it's much faster
# than the gaussian_blur method and produces no observable difference. The
# exact amount of blurring is a judgment call. The higher the 2nd argument, the
@@ -70,9 +70,9 @@
# At this point the vignette is complete. However, the `display' method only
# 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}"}
+checkerboard = Image.read('pattern:checkerboard') { self.size = "#{ballerina.columns}x#{ballerina.rows}" }
vignette = checkerboard[0].composite(ballerina, CenterGravity, OverCompositeOp)
vignette.display
exit