rmagick 3.1.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rmagick might be problematic. Click here for more details.

Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.appveyor.yml +4 -4
  3. data/.circleci/config.yml +1 -1
  4. data/.gitignore +1 -0
  5. data/.rubocop_todo.yml +6 -0
  6. data/.travis.yml +26 -8
  7. data/CHANGELOG.md +104 -0
  8. data/before_install_linux.sh +19 -10
  9. data/benchmarks/memory/README.md +50 -0
  10. data/benchmarks/memory/image_new.rb +8 -0
  11. data/benchmarks/memory/rmagick.gnuplot +16 -0
  12. data/doc/ex/coalesce.rb +2 -2
  13. data/doc/ex/drawcomp.rb +3 -3
  14. data/doc/ex/get_pixels.rb +1 -1
  15. data/doc/ex/images/Coffee.png +0 -0
  16. data/doc/ex/images/No.png +0 -0
  17. data/doc/ex/images/Snake.png +0 -0
  18. data/doc/ex/implode.rb +2 -2
  19. data/doc/ex/mask.rb +1 -1
  20. data/doc/ex/matte_fill_to_border.rb +1 -1
  21. data/doc/ex/matte_floodfill.rb +1 -1
  22. data/doc/ex/matte_replace.rb +1 -1
  23. data/doc/ex/stegano.rb +1 -1
  24. data/examples/constitute.rb +1 -1
  25. data/examples/crop_with_gravity.rb +1 -1
  26. data/examples/demo.rb +4 -4
  27. data/examples/find_similar_region.rb +1 -1
  28. data/examples/histogram.rb +3 -3
  29. data/examples/identify.rb +46 -46
  30. data/examples/image_opacity.rb +2 -2
  31. data/examples/vignette.rb +3 -3
  32. data/ext/RMagick/extconf.rb +19 -15
  33. data/ext/RMagick/rmagick.c +1 -2
  34. data/ext/RMagick/rmagick.h +59 -30
  35. data/ext/RMagick/rmdraw.c +62 -274
  36. data/ext/RMagick/rmenum.c +121 -665
  37. data/ext/RMagick/rmfill.c +7 -7
  38. data/ext/RMagick/rmilist.c +91 -7
  39. data/ext/RMagick/rmimage.c +568 -379
  40. data/ext/RMagick/rminfo.c +152 -110
  41. data/ext/RMagick/rmkinfo.c +17 -1
  42. data/ext/RMagick/rmmain.c +75 -74
  43. data/ext/RMagick/rmmontage.c +33 -33
  44. data/ext/RMagick/rmpixel.c +75 -14
  45. data/ext/RMagick/rmstruct.c +5 -5
  46. data/ext/RMagick/rmutil.c +3 -13
  47. data/lib/obsolete.rb +66 -0
  48. data/lib/rmagick/version.rb +1 -1
  49. data/lib/rmagick_internal.rb +54 -41
  50. data/spec/rmagick/image/composite_spec.rb +5 -76
  51. data/spec/rmagick/image/properties_spec.rb +1 -1
  52. data/test/Draw.rb +52 -115
  53. data/test/Enum.rb +153 -1
  54. data/test/Fill.rb +1 -1
  55. data/test/Image1.rb +97 -43
  56. data/test/Image2.rb +140 -36
  57. data/test/Image3.rb +110 -120
  58. data/test/ImageList1.rb +46 -11
  59. data/test/ImageList2.rb +11 -21
  60. data/test/Image_attributes.rb +81 -127
  61. data/test/Import_Export.rb +2 -2
  62. data/test/Info.rb +5 -1
  63. data/test/KernelInfo.rb +67 -0
  64. data/test/Magick.rb +17 -35
  65. data/test/Pixel.rb +193 -24
  66. data/test/PolaroidOptions.rb +1 -1
  67. data/test/Preview.rb +3 -35
  68. data/test/Struct.rb +45 -0
  69. data/test/appearance/Montage.rb +26 -0
  70. data/test/appearance/appearance_assertion.rb +13 -0
  71. data/test/appearance/expected/montage_border_color.jpg +0 -0
  72. data/test/lib/Obsolete.rb +30 -0
  73. data/test/lib/internal/Draw.rb +823 -0
  74. data/test/lib/internal/Geometry.rb +98 -0
  75. data/test/lib/internal/Magick.rb +40 -0
  76. data/test/test_all_basic.rb +16 -17
  77. metadata +27 -5
  78. data/doc/ex/images/Coffee.wmf +0 -0
  79. data/doc/ex/images/No.wmf +0 -0
  80. data/doc/ex/images/Snake.wmf +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14fbc044f6437f806685330840ec7a65eca53394c52e9c83bb125764cbcfcec7
4
- data.tar.gz: 5497e651500e3bcf58c1055e68fac7a5f754757119c03a3b6916663660c53ade
3
+ metadata.gz: 1bc6ac748ddb89b0be62b816518a4193167fb74eab1d482187a2e8fc5b3bc707
4
+ data.tar.gz: 509ab59e79d7ba1a47e18dacdf5032a014df73e791c63313f1faa88efc1a6a64
5
5
  SHA512:
6
- metadata.gz: 14c5cabe80554f502aef129861aa8ba0fb0eb7d2c5ad37a8ea4120a2d600912fd8dcb4c40cca5e1c2d55a2372f82e54b885ec53acf69a1af227cc3ca553084d3
7
- data.tar.gz: f72d9459f44f9680a3dd30a96d948e70aefceefa8b4b751bfd3286d36e06d1b834f9b1c850c119ebc61e6f2a7dde7167f6a44f554d56eccddb68151601782d7a
6
+ metadata.gz: eaf280335cb5d4e9fc67c769d3b91308ab84689012e399eaf92043ab4058655fcac0087836bfed05647e2f813c30d823f9d664cc31143a02b7ba76c0747b412d
7
+ data.tar.gz: 8d08619eb5ae6bf689e0c05d59da465d9b53c1c090733fe723d5d0f020e332bafc841860f86b6d38e21bb85fb12da59ebf2a97e3a6f8136f9c405565c8c01d64
@@ -8,25 +8,25 @@ environment:
8
8
  PATCH_VERSION: 10
9
9
  - RUBY_VERSION: 23-x64
10
10
  IMAGEMAGICK_VERSION: 6.9.10
11
- PATCH_VERSION: 40
11
+ PATCH_VERSION: 49
12
12
  - RUBY_VERSION: 24-x64
13
13
  IMAGEMAGICK_VERSION: 6.8.9
14
14
  PATCH_VERSION: 10
15
15
  - RUBY_VERSION: 24-x64
16
16
  IMAGEMAGICK_VERSION: 6.9.10
17
- PATCH_VERSION: 40
17
+ PATCH_VERSION: 49
18
18
  - RUBY_VERSION: 25-x64
19
19
  IMAGEMAGICK_VERSION: 6.8.9
20
20
  PATCH_VERSION: 10
21
21
  - RUBY_VERSION: 25-x64
22
22
  IMAGEMAGICK_VERSION: 6.9.10
23
- PATCH_VERSION: 40
23
+ PATCH_VERSION: 49
24
24
  - RUBY_VERSION: 26-x64
25
25
  IMAGEMAGICK_VERSION: 6.8.9
26
26
  PATCH_VERSION: 10
27
27
  - RUBY_VERSION: 26-x64
28
28
  IMAGEMAGICK_VERSION: 6.9.10
29
- PATCH_VERSION: 40
29
+ PATCH_VERSION: 49
30
30
 
31
31
  install:
32
32
  - appveyor-retry appveyor DownloadFile https://ftp.icm.edu.pl/pub/graphics/ImageMagick/binaries/ImageMagick-%IMAGEMAGICK_VERSION%-%PATCH_VERSION%-Q16-x64-dll.exe
@@ -17,7 +17,7 @@ jobs:
17
17
  - run:
18
18
  name: setup linux
19
19
  command: |
20
- IMAGEMAGICK_VERSION=6.9.10-40 bash before_install_linux.sh
20
+ IMAGEMAGICK_VERSION=6.9.10-49 bash before_install_linux.sh
21
21
 
22
22
  - run:
23
23
  name: install dependencies
data/.gitignore CHANGED
@@ -20,3 +20,4 @@ tmp
20
20
  *.o
21
21
  *.a
22
22
  mkmf.log
23
+ build-ImageMagick/
@@ -105,6 +105,7 @@ Lint/NumberConversion:
105
105
  - 'lib/rvg/to_c.rb'
106
106
  - 'test/Import_Export.rb'
107
107
  - 'test/Enum.rb'
108
+ - 'test/lib/internal/Geometry.rb'
108
109
 
109
110
  # Offense count: 1
110
111
  Lint/RescueException:
@@ -368,6 +369,7 @@ Style/AutoResourceCleanup:
368
369
  Style/CaseEquality:
369
370
  Exclude:
370
371
  - 'test/Enum.rb'
372
+ - 'test/Pixel.rb'
371
373
 
372
374
  # Offense count: 6
373
375
  # Cop supports --auto-correct.
@@ -424,6 +426,10 @@ Style/EvalWithLocation:
424
426
  - 'lib/rmagick_internal.rb'
425
427
  - 'lib/rvg/units.rb'
426
428
 
429
+ Style/FormatString:
430
+ Exclude:
431
+ - 'examples/identify.rb'
432
+
427
433
  # Offense count: 158
428
434
  # Configuration parameters: EnforcedStyle.
429
435
  # SupportedStyles: annotated, template, unannotated
@@ -2,10 +2,28 @@ language: ruby
2
2
 
3
3
  cache:
4
4
  directories:
5
- - ~/.ccache
5
+ - ~/.cache/rubocop_cache
6
6
  - vendor/bundle
7
7
  - build-ImageMagick
8
8
 
9
+ dist: xenial
10
+ addons:
11
+ apt:
12
+ packages:
13
+ - build-essential
14
+ - libx11-dev
15
+ - libxext-dev
16
+ - zlib1g-dev
17
+ - liblcms2-dev
18
+ - libpng-dev
19
+ - libjpeg-dev
20
+ - libfreetype6-dev
21
+ - libxml2-dev
22
+ - libtiff5-dev
23
+ - libwebp-dev
24
+ - ghostscript
25
+ - ccache
26
+
9
27
  os:
10
28
  - linux
11
29
 
@@ -16,24 +34,24 @@ env:
16
34
  - IMAGEMAGICK_VERSION=6.7.7-10 CONFIGURE_OPTIONS=--enable-hdri
17
35
  - IMAGEMAGICK_VERSION=6.8.9-10
18
36
  - IMAGEMAGICK_VERSION=6.8.9-10 CONFIGURE_OPTIONS=--enable-hdri
19
- - IMAGEMAGICK_VERSION=6.9.10-40
20
- - IMAGEMAGICK_VERSION=6.9.10-40 CONFIGURE_OPTIONS=--enable-hdri
37
+ - IMAGEMAGICK_VERSION=6.9.10-49
38
+ - IMAGEMAGICK_VERSION=6.9.10-49 CONFIGURE_OPTIONS=--enable-hdri
21
39
 
22
40
  before_install:
23
- - source before_install_$TRAVIS_OS_NAME.sh
41
+ - /bin/bash before_install_$TRAVIS_OS_NAME.sh
24
42
 
25
43
  install: bundle install --path=vendor/bundle --verbose
26
44
 
27
45
  rvm:
28
- - 2.3
29
- - 2.4
30
- - 2.5
46
+ - 2.3.8
47
+ - 2.4.5
48
+ - 2.5.3
31
49
  - 2.6
32
50
 
33
51
  matrix:
34
52
  include:
35
53
  - rvm: 2.3
36
- env: STYLE_CHECKS=true IMAGEMAGICK_VERSION=6.8.9-10
54
+ env: STYLE_CHECKS=true
37
55
 
38
56
  notifications:
39
57
  webhooks:
@@ -3,6 +3,110 @@
3
3
  All notable changes to this project are documented in this file.
4
4
  This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
+ ## RMagick 3.2.0
7
+
8
+ This is expected to be the final deprecation release before RMagick 4.0. We
9
+ have added loads of deprecation warnings to clear the pathway for ImageMagick 7
10
+ support. Once you've fixed all of them you should be fine to upgrade to version
11
+ 4.0 without any pain. There are a small handful of edge cases which we could
12
+ not cleanly deprecate, though they should be extremely rare. These will be
13
+ documented in the 4.0 release. Thanks to @dlemstra for the hard work making
14
+ this release possible.
15
+
16
+ The biggest change in moving towards RMagick 4.0 will be the fact that
17
+ `opacity` is deprecated in favor of `alpha`.
18
+
19
+ **NOTE: `opacity` is the opposite of `alpha`!!!**
20
+
21
+ If you are currently passing opacity into methods, you will need to invert the
22
+ value and use the new `alpha:` keyword argument. If you are passing an integer,
23
+ `alpha = 255 - opacity`. An integer `opacity` of 0 is an `alpha` of 255.
24
+
25
+ Also, **major kudos to @Watson1978** for enabling Ruby's memory management in
26
+ (#697). This should go a long way towards improving RMagick's reputation for
27
+ memory usage.
28
+
29
+ Deprecations: (To be removed in RMagick 4.0)
30
+
31
+ - `Info#group` (#578) (no replacement)
32
+ - `Image#blur` (#579) (no replacement)
33
+ - Renamed `AlphaChannelType` to `AlphaChannelOption` (#596)
34
+ - Renamed `DistortImageMethod` to `DistortMethod` (#605)
35
+ - Renamed `FilterTypes` to `FilterType` (#611)
36
+ - Renamed `InterpolatePixelMethod` to `PixelInterpolateMethod` (#613)
37
+ - Renamed `ImageLayerMethod` to `LayerMethod` (#618)
38
+ - Deprecate the `opacity` property of the Pixel class. (use `alpha` instead) (#619)
39
+ - Deprecate old enum names. (use IM7 names instead) (#627)
40
+ - `StaticGravity` (use `CenterGravity` instead) (#638)
41
+ - `Image#sync_profiles` (no replacement) (#640)
42
+ - Deprecate old metric type values (use IM7 names instead) (#647)
43
+ - Deprecate `ResetAlphaChannel` (no replacement) (#644)
44
+ - Deprecate `FlattenAlphaChannel` (no replacement) (#645)
45
+ - Deprecate `MatteChannel` (no replacement) (#646)
46
+ - Deprecate `ConstantVirtualPixelMethod` (no replacement) (#649)
47
+ - Deprecate `IntegerPixel` (no replacement) (#650)
48
+ - Deprecate `Image.combine` (use `ImageList#combine` instead) (#690)
49
+ - Deprecate `Image#opacity` (use `Image#alpha` instead) (#669)
50
+ - Deprecate unnamed argument for opacity in `Image#transparent` (use keyword `alpha:` instead) (#695)
51
+ - Deprecate unnamed argument for opacity in `Image#black_threshold` and `Image#white_threshold.` (use keyword `alpha:` instead) (#709)
52
+ - Deprecate unnamed argument for opacity in `Image#matte_flood_fill` (use keyword `alpha:` instead) (#711)
53
+ - Deprecate unnamed argument for opacity in `Image#paint_transparent` (use keyword `alpha:` instead) (#717)
54
+ - Deprecate unnamed argument for opacity in `Image#transparent_chroma.` (use keyword `alpha:` instead) (#722)
55
+ - Deprecate `Draw#matte` (use `Draw#alpha` instead) (#724)
56
+
57
+ Enhancements:
58
+
59
+ - Many internal adjustments to prepare for ImageMagick 7 support.
60
+ - Added alpha property to the pixel class. (#617)
61
+ - Add combine to the ImageList class. (#589)
62
+ - Add new alpha constants (#651)
63
+ - Add `Image#mask=` (#660)
64
+ - Add `Draw#alpha` to replace `Draw#matte` (#726)
65
+ - Add Draw#image (#720)
66
+ - Add ArchLinux support (#727)
67
+
68
+ Bug Fixes:
69
+
70
+ - Fix `Font#to_s` to not raise error (#569)
71
+ - Fix a SEGV in `Image#reduce_noise` (#576)
72
+ - Fix infinite loop in `Image#compose` (#587)
73
+ - Fix enumeration memory leaks (#592) (#594) (#606) (#610) (#626)
74
+ - Don't allow `Image#class_type` to be set to undefined (#599)
75
+ - Fixed setting the name of the clip path. (#608)
76
+ - Fix memory leak in `Info#view=` (#642)
77
+ - Fix memory leak in `Image.constitute` (#665)
78
+ - Raise error on invalid arguments in `Draw#bezier` (#674)
79
+ - Fix memory leak in `Image#sparse_color` (#683)
80
+ - Prevent negative values for `Image#convolve` (#679)
81
+ - Several cleanups and fixes in the examples
82
+ - Raise error on invalid arguments in `Draw#color` (#691)
83
+ - Raise error on invalid arguments in `Draw#opacity` (#692)
84
+ - Raise error on invalid arguments in `Draw#fill_opacity` (#693)
85
+ - Raise error on invalid arguments in `Draw#stroke_opacity` (#694)
86
+ - Raise error on invalid arguments in `Draw#font_weight` (#696)
87
+ - Raise error on invalid arguments in `Draw#pattern` (#702)
88
+ - Raise error on invalid arguments in `Draw#point` (#703)
89
+ - Raise error on invalid arguments in `Draw#font_size` (#704)
90
+ - Raise error on invalid arguments in `Draw#polygon` (#705)
91
+ - Raise error on invalid arguments in `Draw#polyline` (#706)
92
+ - Raise error on invalid arguments in `Draw#rotate` (#707)
93
+ - Raise error on invalid arguments in `Draw#scale` (#708)
94
+ - Raise error on invalid arguments in `Draw#stroke_dashoffset` (#710)
95
+ - Raise error on invalid arguments in `Draw#translate` (#713)
96
+ - Raise error on invalid arguments in `Draw#text` (#714)
97
+ - Raise error on invalid arguments in `Draw#stroke` (#715)
98
+ - Raise error on invalid arguments in `Draw#matte` (#716)
99
+ - Raise error on invalid arguments in `Draw#skewx`, `Draw#skewy` (#719)
100
+ - Fix `Image#thumbnail` to keep image aspect ratio like ImageMagick (#718)
101
+ - Fix bug where `ImageList#montage` doesn't apply `border_color` & `matte_color` (#601)
102
+ - Fix stack-buffer-overflow in `Draw#annotate` (#725)
103
+ - Enable managed memory feature (#697)
104
+
105
+ Code Quality:
106
+
107
+ - Many tests written
108
+ - Several fixes to reduce compiler warnings.
109
+
6
110
  ## RMagick 3.1.0
7
111
 
8
112
  Deprecations: (To be removed in RMagick 4.0)
@@ -1,14 +1,11 @@
1
1
  set -euox pipefail
2
2
 
3
- sudo apt-get update
4
-
5
- # remove all existing imagemagick related packages
6
- sudo apt-get autoremove -y imagemagick* libmagick* --purge
3
+ gem install bundler
7
4
 
8
- # install build tools, ImageMagick delegates
9
- sudo apt-get install -y build-essential libx11-dev libxext-dev zlib1g-dev \
10
- liblcms2-dev libpng-dev libjpeg-dev libfreetype6-dev libxml2-dev \
11
- libtiff5-dev libwebp-dev vim ghostscript ccache
5
+ if [ -v STYLE_CHECKS ]; then
6
+ set +ux
7
+ exit 0
8
+ fi
12
9
 
13
10
  if [ ! -v IMAGEMAGICK_VERSION ]; then
14
11
  echo "you must specify an ImageMagick version."
@@ -16,6 +13,18 @@ if [ ! -v IMAGEMAGICK_VERSION ]; then
16
13
  exit 1
17
14
  fi
18
15
 
16
+ # remove all existing imagemagick related packages
17
+ sudo apt-get autoremove -y imagemagick* libmagick* --purge
18
+
19
+ if [ ! -v TRAVIS ]; then
20
+ sudo apt-get update
21
+
22
+ # install build tools, ImageMagick delegates
23
+ sudo apt-get install -y build-essential libx11-dev libxext-dev zlib1g-dev \
24
+ liblcms2-dev libpng-dev libjpeg-dev libfreetype6-dev libxml2-dev \
25
+ libtiff5-dev libwebp-dev vim ghostscript ccache
26
+ fi
27
+
19
28
  if [ ! -d /usr/include/freetype ]; then
20
29
  # If `/usr/include/freetype` is not existed, ImageMagick 6.7 configuration fails about Freetype.
21
30
  sudo ln -sf /usr/include/freetype2 /usr/include/freetype
@@ -34,10 +43,12 @@ build_imagemagick() {
34
43
  if (( "${version[0]}${version[1]}" >= 69 )); then
35
44
  wget https://github.com/ImageMagick/ImageMagick6/archive/${IMAGEMAGICK_VERSION}.tar.gz
36
45
  tar -xf ${IMAGEMAGICK_VERSION}.tar.gz
46
+ rm ${IMAGEMAGICK_VERSION}.tar.gz
37
47
  mv ImageMagick6-${IMAGEMAGICK_VERSION} $build_dir
38
48
  else
39
49
  wget https://www.imagemagick.org/download/releases/ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz
40
50
  tar -xf ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz
51
+ rm ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz
41
52
  mv ImageMagick-${IMAGEMAGICK_VERSION} $build_dir
42
53
  fi
43
54
 
@@ -61,6 +72,4 @@ cd $project_dir
61
72
 
62
73
  sudo ldconfig
63
74
 
64
- gem install bundler
65
-
66
75
  set +ux
@@ -0,0 +1,50 @@
1
+ # How to measure the memory usage
2
+
3
+ ## 1. Install gnuplot
4
+ If you need a graph of memory usage, it can draw the graph with `gnuplot`.
5
+
6
+ With `Homebrew`, you can install `gnuplot` like
7
+
8
+ ```
9
+ $ brew install gnuplot
10
+ ```
11
+
12
+ ## 2. Retrieve two performance data `before` / `after`
13
+ Retrieve data before applying patches.
14
+
15
+ ```
16
+ $ rake build
17
+ $ gem install pkg/rmagick-3.1.0.gem
18
+ $ cd benchmarks/memory
19
+ $ ruby image_new.rb > before.csv
20
+ ```
21
+
22
+ Apply the patches then retrieve improved data.
23
+
24
+ ```
25
+ $ rake build
26
+ $ gem install pkg/rmagick-3.1.0.gem
27
+ $ cd benchmarks/memory
28
+ $ ruby image_new.rb > after.csv
29
+ ```
30
+
31
+ ## 3. Draw the performance graph
32
+ Launch `gnuplot` and execute `load 'rmagick.gnuplot'` command in prompt then the performance graph will be drew.
33
+
34
+ ```
35
+ $ cd benchmarks/memory
36
+ $ gnuplot
37
+
38
+ G N U P L O T
39
+ Version 5.2 patchlevel 7 last modified 2019-05-29
40
+
41
+ Copyright (C) 1986-1993, 1998, 2004, 2007-2018
42
+ Thomas Williams, Colin Kelley and many others
43
+
44
+ gnuplot home: http://www.gnuplot.info
45
+ faq, bugs, etc: type "help FAQ"
46
+ immediate help: type "help" (plot window: hit 'h')
47
+
48
+ Terminal type is now 'qt'
49
+ gnuplot> load 'rmagick.gnuplot'
50
+ ```
@@ -0,0 +1,8 @@
1
+ require 'rmagick'
2
+
3
+ 1000.times do |i|
4
+ Magick::Image.new(1000, 1000)
5
+
6
+ rss = Integer(`ps -o rss= -p #{Process.pid}`) / 1024.0
7
+ puts "#{i},#{rss}"
8
+ end
@@ -0,0 +1,16 @@
1
+ set datafile separator ","
2
+
3
+ set key outside center top horizontal reverse Left samplen 2
4
+ unset border
5
+ set xtics scale 0
6
+ set ytics scale 0
7
+ set grid ytics linewidth 1 linetype -1
8
+
9
+ set style line 1 lt 1 lc rgbcolor "#3465a4" lw 2.5 pt 7 ps 1
10
+ set style line 2 lt 1 lc rgbcolor "#ff6347" lw 2.5 pt 7 ps 1
11
+ set style line 3 lt 1 lc rgbcolor "#888a85" lw 2.5 pt 5 ps 1
12
+
13
+ set xlabel "Nth loop"
14
+ set ylabel "Memory usage (MiB)"
15
+
16
+ plot "before.csv" with line linestyle 1, "after.csv" with line linestyle 2
@@ -19,7 +19,7 @@ cells = Magick::ImageList.new
19
19
  cells.new_image buttons.columns * 5, buttons.rows * 5 do
20
20
  self.background_color = '#000000ff' # transparent
21
21
  end
22
- cells.matte = true
22
+ cells.alpha(Magick::ActivateAlphaChannel)
23
23
 
24
24
  offset = Magick::Rectangle.new(0, 0, 0, 0)
25
25
 
@@ -44,7 +44,7 @@ srand 1234
44
44
  offset.x = x * button.columns
45
45
  offset.y = y * button.rows
46
46
  button.page = offset
47
- button.matte = true
47
+ button.alpha(Magick::ActivateAlphaChannel)
48
48
  cells << button
49
49
  end
50
50
 
@@ -4,16 +4,16 @@ require 'rmagick'
4
4
 
5
5
  # Read the snake image file and scale to 200 pixels high.
6
6
  begin
7
- snake = Magick::ImageList.new('images/Snake.wmf')
7
+ snake = Magick::ImageList.new('images/Snake.png')
8
8
  snake.scale!(200.0 / snake.rows)
9
9
 
10
10
  # Read the coffee cup image and scale to 200 pixels high.
11
- coffee = Magick::ImageList.new('images/Coffee.wmf')
11
+ coffee = Magick::ImageList.new('images/Coffee.png')
12
12
  coffee.scale!(200.0 / coffee.rows)
13
13
 
14
14
  # We want the "no" symbol to be a little smaller.
15
15
  # Read and scale to 150 pixels high.
16
- sign = Magick::ImageList.new('images/No.wmf')
16
+ sign = Magick::ImageList.new('images/No.png')
17
17
  sign.scale!(150.0 / sign.rows)
18
18
 
19
19
  # Change the white pixels in the sign to transparent.
@@ -38,7 +38,7 @@ rows.times do |y|
38
38
  end
39
39
 
40
40
  # Composite the mono version of the image over the color version.
41
- grayrocks.matte = true
41
+ grayrocks.alpha(Magick::ActivateAlphaChannel)
42
42
  combine = rocks.composite(grayrocks, Magick::CenterGravity, Magick::OverCompositeOp)
43
43
  # combine.display
44
44
  combine.write 'get_pixels.jpg'
Binary file
Binary file