rmagick 4.1.0.rc2 → 4.1.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 (412) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +63 -0
  3. data/.editorconfig +3 -0
  4. data/.github/workflows/ci.yml +148 -0
  5. data/.gitignore +3 -1
  6. data/.rspec +1 -0
  7. data/.rubocop.yml +24 -0
  8. data/.rubocop_todo.yml +80 -270
  9. data/.yardopts +5 -0
  10. data/CHANGELOG.md +63 -0
  11. data/CONTRIBUTING.md +14 -10
  12. data/README.md +292 -0
  13. data/Rakefile +16 -22
  14. data/before_install_linux.sh +22 -32
  15. data/before_install_osx.sh +56 -2
  16. data/ext/RMagick/extconf.rb +100 -94
  17. data/ext/RMagick/rmagick.c +77 -104
  18. data/ext/RMagick/rmagick.h +74 -70
  19. data/ext/RMagick/rmdraw.c +261 -444
  20. data/ext/RMagick/rmenum.c +96 -113
  21. data/ext/RMagick/rmfill.c +46 -77
  22. data/ext/RMagick/rmilist.c +136 -244
  23. data/ext/RMagick/rmimage.c +3395 -4166
  24. data/ext/RMagick/rminfo.c +531 -737
  25. data/ext/RMagick/rmkinfo.c +21 -87
  26. data/ext/RMagick/rmmain.c +405 -245
  27. data/ext/RMagick/rmmontage.c +60 -126
  28. data/ext/RMagick/rmpixel.c +401 -345
  29. data/ext/RMagick/rmstruct.c +62 -88
  30. data/ext/RMagick/rmutil.c +112 -218
  31. data/lib/rmagick/version.rb +1 -1
  32. data/lib/rmagick_internal.rb +128 -77
  33. data/lib/rvg/clippath.rb +2 -1
  34. data/lib/rvg/container.rb +10 -5
  35. data/lib/rvg/describable.rb +1 -1
  36. data/lib/rvg/embellishable.rb +5 -4
  37. data/lib/rvg/misc.rb +15 -12
  38. data/lib/rvg/paint.rb +2 -1
  39. data/lib/rvg/pathdata.rb +12 -11
  40. data/lib/rvg/rvg.rb +8 -4
  41. data/lib/rvg/stylable.rb +9 -7
  42. data/lib/rvg/text.rb +11 -6
  43. data/lib/rvg/transformable.rb +3 -2
  44. data/lib/rvg/units.rb +1 -1
  45. data/rmagick.gemspec +7 -6
  46. metadata +31 -421
  47. data/.appveyor.yml +0 -57
  48. data/.circleci/config.yml +0 -56
  49. data/.ruby-version +0 -1
  50. data/.simplecov +0 -27
  51. data/.travis.yml +0 -64
  52. data/Doxyfile +0 -1514
  53. data/README.textile +0 -259
  54. data/benchmarks/memory/README.md +0 -50
  55. data/benchmarks/memory/image_new.rb +0 -8
  56. data/benchmarks/memory/rmagick.gnuplot +0 -16
  57. data/doc/.cvsignore +0 -1
  58. data/doc/comtasks.html +0 -287
  59. data/doc/constants.html +0 -1581
  60. data/doc/css/doc.css +0 -299
  61. data/doc/css/popup.css +0 -34
  62. data/doc/css/ref.css +0 -67
  63. data/doc/draw.html +0 -3272
  64. data/doc/ex/InitialCoords.rb +0 -22
  65. data/doc/ex/NewCoordSys.rb +0 -30
  66. data/doc/ex/OrigCoordSys.rb +0 -16
  67. data/doc/ex/PreserveAspectRatio.rb +0 -204
  68. data/doc/ex/RotateScale.rb +0 -36
  69. data/doc/ex/Skew.rb +0 -38
  70. data/doc/ex/Use01.rb +0 -15
  71. data/doc/ex/Use02.rb +0 -20
  72. data/doc/ex/Use03.rb +0 -16
  73. data/doc/ex/ViewBox.rb +0 -31
  74. data/doc/ex/adaptive_threshold.rb +0 -9
  75. data/doc/ex/add_noise.rb +0 -16
  76. data/doc/ex/affine.rb +0 -48
  77. data/doc/ex/affine_transform.rb +0 -20
  78. data/doc/ex/arc.rb +0 -49
  79. data/doc/ex/arcpath.rb +0 -32
  80. data/doc/ex/arcs01.rb +0 -28
  81. data/doc/ex/arcs02.rb +0 -59
  82. data/doc/ex/average.rb +0 -15
  83. data/doc/ex/axes.rb +0 -64
  84. data/doc/ex/baseline_shift01.rb +0 -17
  85. data/doc/ex/bilevel_channel.rb +0 -8
  86. data/doc/ex/blur_image.rb +0 -12
  87. data/doc/ex/border.rb +0 -10
  88. data/doc/ex/bounding_box.rb +0 -42
  89. data/doc/ex/cbezier1.rb +0 -41
  90. data/doc/ex/cbezier2.rb +0 -41
  91. data/doc/ex/cbezier3.rb +0 -41
  92. data/doc/ex/cbezier4.rb +0 -42
  93. data/doc/ex/cbezier5.rb +0 -42
  94. data/doc/ex/cbezier6.rb +0 -53
  95. data/doc/ex/channel.rb +0 -25
  96. data/doc/ex/charcoal.rb +0 -12
  97. data/doc/ex/chop.rb +0 -29
  98. data/doc/ex/circle.rb +0 -33
  99. data/doc/ex/circle01.rb +0 -16
  100. data/doc/ex/clip_path.rb +0 -60
  101. data/doc/ex/coalesce.rb +0 -57
  102. data/doc/ex/color_fill_to_border.rb +0 -29
  103. data/doc/ex/color_floodfill.rb +0 -28
  104. data/doc/ex/color_histogram.rb +0 -47
  105. data/doc/ex/color_reset.rb +0 -11
  106. data/doc/ex/colorize.rb +0 -16
  107. data/doc/ex/colors.rb +0 -64
  108. data/doc/ex/compose_mask.rb +0 -22
  109. data/doc/ex/composite.rb +0 -133
  110. data/doc/ex/composite_layers.rb +0 -52
  111. data/doc/ex/composite_tiled.rb +0 -21
  112. data/doc/ex/contrast.rb +0 -36
  113. data/doc/ex/crop.rb +0 -31
  114. data/doc/ex/crop_with_gravity.rb +0 -42
  115. data/doc/ex/cubic01.rb +0 -43
  116. data/doc/ex/cubic02.rb +0 -91
  117. data/doc/ex/cycle_colormap.rb +0 -21
  118. data/doc/ex/dissolve.rb +0 -12
  119. data/doc/ex/drawcomp.rb +0 -41
  120. data/doc/ex/drop_shadow.rb +0 -60
  121. data/doc/ex/edge.rb +0 -11
  122. data/doc/ex/ellipse.rb +0 -45
  123. data/doc/ex/ellipse01.rb +0 -21
  124. data/doc/ex/emboss.rb +0 -11
  125. data/doc/ex/enhance.rb +0 -28
  126. data/doc/ex/equalize.rb +0 -11
  127. data/doc/ex/evenodd.rb +0 -42
  128. data/doc/ex/fill_pattern.rb +0 -23
  129. data/doc/ex/flatten_images.rb +0 -36
  130. data/doc/ex/flip.rb +0 -11
  131. data/doc/ex/flop.rb +0 -11
  132. data/doc/ex/font_styles.rb +0 -32
  133. data/doc/ex/fonts.rb +0 -16
  134. data/doc/ex/frame.rb +0 -12
  135. data/doc/ex/gaussian_blur.rb +0 -11
  136. data/doc/ex/get_multiline_type_metrics.rb +0 -41
  137. data/doc/ex/get_pixels.rb +0 -45
  138. data/doc/ex/get_type_metrics.rb +0 -142
  139. data/doc/ex/gradientfill.rb +0 -27
  140. data/doc/ex/grav.rb +0 -45
  141. data/doc/ex/gravity.rb +0 -78
  142. data/doc/ex/group.rb +0 -26
  143. data/doc/ex/hatchfill.rb +0 -27
  144. data/doc/ex/image.rb +0 -44
  145. data/doc/ex/images/Apple.miff +0 -0
  146. data/doc/ex/images/Ballerina.jpg +0 -0
  147. data/doc/ex/images/Ballerina3.jpg +0 -0
  148. data/doc/ex/images/Button_0.gif +0 -0
  149. data/doc/ex/images/Button_1.gif +0 -0
  150. data/doc/ex/images/Button_2.gif +0 -0
  151. data/doc/ex/images/Button_3.gif +0 -0
  152. data/doc/ex/images/Button_4.gif +0 -0
  153. data/doc/ex/images/Button_5.gif +0 -0
  154. data/doc/ex/images/Button_6.gif +0 -0
  155. data/doc/ex/images/Button_7.gif +0 -0
  156. data/doc/ex/images/Button_8.gif +0 -0
  157. data/doc/ex/images/Button_9.gif +0 -0
  158. data/doc/ex/images/Button_A.gif +0 -0
  159. data/doc/ex/images/Button_B.gif +0 -0
  160. data/doc/ex/images/Button_C.gif +0 -0
  161. data/doc/ex/images/Button_D.gif +0 -0
  162. data/doc/ex/images/Button_E.gif +0 -0
  163. data/doc/ex/images/Button_F.gif +0 -0
  164. data/doc/ex/images/Button_G.gif +0 -0
  165. data/doc/ex/images/Button_H.gif +0 -0
  166. data/doc/ex/images/Button_I.gif +0 -0
  167. data/doc/ex/images/Button_J.gif +0 -0
  168. data/doc/ex/images/Button_K.gif +0 -0
  169. data/doc/ex/images/Button_L.gif +0 -0
  170. data/doc/ex/images/Button_M.gif +0 -0
  171. data/doc/ex/images/Button_N.gif +0 -0
  172. data/doc/ex/images/Button_O.gif +0 -0
  173. data/doc/ex/images/Button_P.gif +0 -0
  174. data/doc/ex/images/Button_Q.gif +0 -0
  175. data/doc/ex/images/Button_R.gif +0 -0
  176. data/doc/ex/images/Button_S.gif +0 -0
  177. data/doc/ex/images/Button_T.gif +0 -0
  178. data/doc/ex/images/Button_U.gif +0 -0
  179. data/doc/ex/images/Button_V.gif +0 -0
  180. data/doc/ex/images/Button_W.gif +0 -0
  181. data/doc/ex/images/Button_X.gif +0 -0
  182. data/doc/ex/images/Button_Y.gif +0 -0
  183. data/doc/ex/images/Button_Z.gif +0 -0
  184. data/doc/ex/images/Cheetah.jpg +0 -0
  185. data/doc/ex/images/Coffee.png +0 -0
  186. data/doc/ex/images/Flower_Hat.jpg +0 -0
  187. data/doc/ex/images/Gold_Statue.jpg +0 -0
  188. data/doc/ex/images/Hot_Air_Balloons.jpg +0 -0
  189. data/doc/ex/images/Hot_Air_Balloons_H.jpg +0 -0
  190. data/doc/ex/images/Leaf.miff +0 -0
  191. data/doc/ex/images/No.png +0 -0
  192. data/doc/ex/images/Polynesia.jpg +0 -0
  193. data/doc/ex/images/Red_Rocks.jpg +0 -0
  194. data/doc/ex/images/Rocks_On_Beach.miff +0 -0
  195. data/doc/ex/images/Shorts.jpg +0 -0
  196. data/doc/ex/images/Snake.png +0 -0
  197. data/doc/ex/images/Violin.jpg +0 -0
  198. data/doc/ex/images/Yellow_Rose.miff +0 -0
  199. data/doc/ex/images/big-duck.gif +0 -0
  200. data/doc/ex/images/duck.gif +0 -0
  201. data/doc/ex/images/duck0.gif +0 -0
  202. data/doc/ex/images/duck1.gif +0 -0
  203. data/doc/ex/images/duck10.gif +0 -0
  204. data/doc/ex/images/duck11.gif +0 -0
  205. data/doc/ex/images/duck12.gif +0 -0
  206. data/doc/ex/images/duck13.gif +0 -0
  207. data/doc/ex/images/duck14.gif +0 -0
  208. data/doc/ex/images/duck15.gif +0 -0
  209. data/doc/ex/images/duck2.gif +0 -0
  210. data/doc/ex/images/duck3.gif +0 -0
  211. data/doc/ex/images/duck4.gif +0 -0
  212. data/doc/ex/images/duck5.gif +0 -0
  213. data/doc/ex/images/duck6.gif +0 -0
  214. data/doc/ex/images/duck7.gif +0 -0
  215. data/doc/ex/images/duck8.gif +0 -0
  216. data/doc/ex/images/duck9.gif +0 -0
  217. data/doc/ex/images/graydient230x6.gif +0 -0
  218. data/doc/ex/images/image_with_profile.jpg +0 -0
  219. data/doc/ex/images/logo400x83.gif +0 -0
  220. data/doc/ex/images/model.miff +0 -0
  221. data/doc/ex/images/notimplemented.gif +0 -0
  222. data/doc/ex/images/smile.miff +0 -0
  223. data/doc/ex/images/spin.gif +0 -0
  224. data/doc/ex/implode.rb +0 -34
  225. data/doc/ex/level.rb +0 -11
  226. data/doc/ex/level_colors.rb +0 -11
  227. data/doc/ex/line.rb +0 -41
  228. data/doc/ex/line01.rb +0 -21
  229. data/doc/ex/mask.rb +0 -35
  230. data/doc/ex/matte_fill_to_border.rb +0 -39
  231. data/doc/ex/matte_floodfill.rb +0 -32
  232. data/doc/ex/matte_replace.rb +0 -39
  233. data/doc/ex/median_filter.rb +0 -28
  234. data/doc/ex/modulate.rb +0 -11
  235. data/doc/ex/mono.rb +0 -23
  236. data/doc/ex/morph.rb +0 -25
  237. data/doc/ex/mosaic.rb +0 -37
  238. data/doc/ex/motion_blur.rb +0 -11
  239. data/doc/ex/negate.rb +0 -11
  240. data/doc/ex/negate_channel.rb +0 -9
  241. data/doc/ex/nested_rvg.rb +0 -21
  242. data/doc/ex/nonzero.rb +0 -42
  243. data/doc/ex/normalize.rb +0 -11
  244. data/doc/ex/oil_paint.rb +0 -11
  245. data/doc/ex/opacity.rb +0 -37
  246. data/doc/ex/ordered_dither.rb +0 -11
  247. data/doc/ex/path.rb +0 -63
  248. data/doc/ex/pattern1.rb +0 -25
  249. data/doc/ex/pattern2.rb +0 -26
  250. data/doc/ex/polaroid.rb +0 -26
  251. data/doc/ex/polygon.rb +0 -23
  252. data/doc/ex/polygon01.rb +0 -21
  253. data/doc/ex/polyline.rb +0 -22
  254. data/doc/ex/polyline01.rb +0 -21
  255. data/doc/ex/posterize.rb +0 -8
  256. data/doc/ex/preview.rb +0 -8
  257. data/doc/ex/qbezierpath.rb +0 -52
  258. data/doc/ex/quad01.rb +0 -34
  259. data/doc/ex/quantize-m.rb +0 -25
  260. data/doc/ex/radial_blur.rb +0 -9
  261. data/doc/ex/raise.rb +0 -8
  262. data/doc/ex/random_threshold_channel.rb +0 -13
  263. data/doc/ex/rect01.rb +0 -14
  264. data/doc/ex/rect02.rb +0 -20
  265. data/doc/ex/rectangle.rb +0 -34
  266. data/doc/ex/reduce_noise.rb +0 -28
  267. data/doc/ex/remap.rb +0 -11
  268. data/doc/ex/remap_images.rb +0 -19
  269. data/doc/ex/resize_to_fill.rb +0 -8
  270. data/doc/ex/resize_to_fit.rb +0 -8
  271. data/doc/ex/roll.rb +0 -9
  272. data/doc/ex/rotate.rb +0 -44
  273. data/doc/ex/rotate_f.rb +0 -14
  274. data/doc/ex/roundrect.rb +0 -33
  275. data/doc/ex/rubyname.rb +0 -30
  276. data/doc/ex/rvg_clippath.rb +0 -12
  277. data/doc/ex/rvg_linecap.rb +0 -42
  278. data/doc/ex/rvg_linejoin.rb +0 -40
  279. data/doc/ex/rvg_opacity.rb +0 -18
  280. data/doc/ex/rvg_pattern.rb +0 -26
  281. data/doc/ex/rvg_stroke_dasharray.rb +0 -11
  282. data/doc/ex/segment.rb +0 -11
  283. data/doc/ex/sepiatone.rb +0 -7
  284. data/doc/ex/shade.rb +0 -11
  285. data/doc/ex/shadow.rb +0 -30
  286. data/doc/ex/shave.rb +0 -15
  287. data/doc/ex/shear.rb +0 -10
  288. data/doc/ex/sketch.rb +0 -17
  289. data/doc/ex/skewx.rb +0 -51
  290. data/doc/ex/skewy.rb +0 -47
  291. data/doc/ex/smile.rb +0 -126
  292. data/doc/ex/solarize.rb +0 -11
  293. data/doc/ex/sparse_color.rb +0 -55
  294. data/doc/ex/splice.rb +0 -8
  295. data/doc/ex/spread.rb +0 -11
  296. data/doc/ex/stegano.rb +0 -54
  297. data/doc/ex/stroke_dasharray.rb +0 -42
  298. data/doc/ex/stroke_fill.rb +0 -10
  299. data/doc/ex/stroke_linecap.rb +0 -44
  300. data/doc/ex/stroke_linejoin.rb +0 -48
  301. data/doc/ex/stroke_width.rb +0 -49
  302. data/doc/ex/swirl.rb +0 -17
  303. data/doc/ex/text.rb +0 -37
  304. data/doc/ex/text01.rb +0 -16
  305. data/doc/ex/text_align.rb +0 -36
  306. data/doc/ex/text_antialias.rb +0 -37
  307. data/doc/ex/text_styles.rb +0 -19
  308. data/doc/ex/text_undercolor.rb +0 -28
  309. data/doc/ex/texture_fill_to_border.rb +0 -34
  310. data/doc/ex/texture_floodfill.rb +0 -32
  311. data/doc/ex/texturefill.rb +0 -24
  312. data/doc/ex/threshold.rb +0 -13
  313. data/doc/ex/to_blob.rb +0 -13
  314. data/doc/ex/translate.rb +0 -39
  315. data/doc/ex/transparent.rb +0 -38
  316. data/doc/ex/transpose.rb +0 -9
  317. data/doc/ex/transverse.rb +0 -9
  318. data/doc/ex/tref01.rb +0 -24
  319. data/doc/ex/triangle01.rb +0 -15
  320. data/doc/ex/trim.rb +0 -23
  321. data/doc/ex/tspan01.rb +0 -17
  322. data/doc/ex/tspan02.rb +0 -17
  323. data/doc/ex/tspan03.rb +0 -19
  324. data/doc/ex/unsharp_mask.rb +0 -28
  325. data/doc/ex/viewex.rb +0 -33
  326. data/doc/ex/vignette.rb +0 -12
  327. data/doc/ex/watermark.rb +0 -27
  328. data/doc/ex/wave.rb +0 -9
  329. data/doc/ex/wet_floor.rb +0 -58
  330. data/doc/ex/writing_mode01.rb +0 -26
  331. data/doc/ex/writing_mode02.rb +0 -26
  332. data/doc/ilist.html +0 -2056
  333. data/doc/image1.html +0 -4680
  334. data/doc/image2.html +0 -3665
  335. data/doc/image3.html +0 -4522
  336. data/doc/imageattrs.html +0 -1638
  337. data/doc/imusage.html +0 -514
  338. data/doc/index.html +0 -416
  339. data/doc/info.html +0 -1499
  340. data/doc/magick.html +0 -570
  341. data/doc/optequiv.html +0 -2435
  342. data/doc/rvg.html +0 -975
  343. data/doc/rvgclip.html +0 -248
  344. data/doc/rvggroup.html +0 -305
  345. data/doc/rvgimage.html +0 -289
  346. data/doc/rvgpattern.html +0 -475
  347. data/doc/rvgshape.html +0 -406
  348. data/doc/rvgstyle.html +0 -270
  349. data/doc/rvgtext.html +0 -465
  350. data/doc/rvgtspan.html +0 -238
  351. data/doc/rvgtut.html +0 -530
  352. data/doc/rvguse.html +0 -145
  353. data/doc/rvgxform.html +0 -294
  354. data/doc/scripts/doc.js +0 -22
  355. data/doc/scripts/stripeTables.js +0 -23
  356. data/doc/struct.html +0 -1339
  357. data/doc/usage.html +0 -1621
  358. data/examples/constitute.rb +0 -7
  359. data/examples/crop_with_gravity.rb +0 -43
  360. data/examples/demo.rb +0 -323
  361. data/examples/describe.rb +0 -41
  362. data/examples/find_similar_region.rb +0 -34
  363. data/examples/histogram.rb +0 -312
  364. data/examples/identify.rb +0 -174
  365. data/examples/image_opacity.rb +0 -28
  366. data/examples/import_export.rb +0 -31
  367. data/examples/pattern_fill.rb +0 -37
  368. data/examples/rotating_text.rb +0 -45
  369. data/examples/spinner.rb +0 -49
  370. data/examples/thumbnail.rb +0 -64
  371. data/examples/vignette.rb +0 -78
  372. data/spec/rmagick/ImageList1_spec.rb +0 -24
  373. data/spec/rmagick/draw_spec.rb +0 -155
  374. data/spec/rmagick/image/blue_shift_spec.rb +0 -14
  375. data/spec/rmagick/image/channel_entropy_spec.rb +0 -9
  376. data/spec/rmagick/image/composite_spec.rb +0 -72
  377. data/spec/rmagick/image/constitute_spec.rb +0 -13
  378. data/spec/rmagick/image/dispatch_spec.rb +0 -16
  379. data/spec/rmagick/image/dissolve_spec.rb +0 -54
  380. data/spec/rmagick/image/from_blob_spec.rb +0 -12
  381. data/spec/rmagick/image/ping_spec.rb +0 -12
  382. data/spec/rmagick/image/properties_spec.rb +0 -27
  383. data/spec/rmagick/image/read_spec.rb +0 -28
  384. data/spec/spec_helper.rb +0 -9
  385. data/spec/support/issue_200/app.rb +0 -8
  386. data/test/Draw.rb +0 -351
  387. data/test/Enum.rb +0 -228
  388. data/test/Fill.rb +0 -93
  389. data/test/Image1.rb +0 -606
  390. data/test/Image2.rb +0 -1408
  391. data/test/Image3.rb +0 -1086
  392. data/test/ImageList1.rb +0 -858
  393. data/test/ImageList2.rb +0 -375
  394. data/test/Image_attributes.rb +0 -635
  395. data/test/Import_Export.rb +0 -111
  396. data/test/Info.rb +0 -436
  397. data/test/KernelInfo.rb +0 -59
  398. data/test/Magick.rb +0 -311
  399. data/test/Pixel.rb +0 -259
  400. data/test/PolaroidOptions.rb +0 -23
  401. data/test/Preview.rb +0 -26
  402. data/test/Struct.rb +0 -45
  403. data/test/appearance/Montage.rb +0 -26
  404. data/test/appearance/appearance_assertion.rb +0 -13
  405. data/test/appearance/expected/montage_border_color.jpg +0 -0
  406. data/test/cmyk.icm +0 -0
  407. data/test/lib/internal/Draw.rb +0 -811
  408. data/test/lib/internal/Geometry.rb +0 -98
  409. data/test/lib/internal/Magick.rb +0 -40
  410. data/test/srgb.icm +0 -0
  411. data/test/test_all_basic.rb +0 -49
  412. data/test/tmpnam_test.rb +0 -50
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env ruby -w
2
-
3
- require 'rmagick'
4
-
5
- img = Magick::Image.read('images/Flower_Hat.jpg').first
6
-
7
- # Make a watermark from the word "RMagick"
8
- mark = Magick::Image.new(140, 40) { self.background_color = 'none' }
9
- gc = Magick::Draw.new
10
-
11
- gc.annotate(mark, 0, 0, 0, -5, 'RMagick') do
12
- gc.gravity = Magick::CenterGravity
13
- gc.pointsize = 32
14
- gc.font_family = if RUBY_PLATFORM =~ /mswin32/
15
- 'Georgia'
16
- else
17
- 'Times'
18
- end
19
- gc.fill = 'white'
20
- gc.stroke = 'none'
21
- end
22
-
23
- mark = mark.wave(2.5, 70).rotate(-90)
24
-
25
- # Composite the watermark in the lower right (southeast) corner.
26
- img2 = img.watermark(mark, 0.25, 0, Magick::SouthEastGravity)
27
- img2.write('watermark.jpg')
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env ruby -w
2
- require 'rmagick'
3
-
4
- img = Magick::Image.read('images/Flower_Hat.jpg').first
5
-
6
- img = img.wave
7
-
8
- img.write('wave.jpg')
9
- exit
@@ -1,58 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'rmagick'
4
-
5
- results = Magick::ImageList.new
6
-
7
- img = Magick::Image.new(270, 60) { self.background_color = 'black' }
8
-
9
- gc = Magick::Draw.new
10
- gc.annotate(img, 0, 0, 0, -15, 'RUBY!') do
11
- gc.fill = '#a00'
12
- gc.stroke = '#f00'
13
- gc.stroke_width = 2
14
- gc.font_weight = Magick::BoldWeight
15
- gc.gravity = Magick::SouthGravity
16
- if RUBY_PLATFORM =~ /mswin32/
17
- gc.font_family = 'Georgia'
18
- gc.pointsize = 76
19
- else
20
- gc.font_family = 'times'
21
- gc.pointsize = 80
22
- end
23
- end
24
-
25
- # Add a little bit of shading
26
- if Magick.const_defined? 'HardLightCompositeOp'
27
- shade = img.shade(true, 310, 30)
28
- img.composite!(shade, Magick::CenterGravity, Magick::HardLightCompositeOp)
29
- end
30
-
31
- # Create the default reflection
32
- reflection = img.wet_floor
33
-
34
- ilist = Magick::ImageList.new
35
- ilist << img << reflection
36
- results << ilist.append(true)
37
-
38
- # Change the initial level of transparency and the rate of transition
39
- ilist[1] = img.wet_floor(0.25, 0.5)
40
- results << ilist.append(true)
41
-
42
- # Add a slant
43
- xform = Magick::AffineMatrix.new(1.0, 0.0, Math::PI / 4.0, 1.0, 0.0, 0.0)
44
- ilist[1] = ilist[1].affine_transform(xform)
45
- results << ilist.append(true)
46
-
47
- # Add a ripple
48
- ilist[1] = ilist[1].rotate(90).wave(2, 10).rotate(-90)
49
- results << ilist.append(true)
50
-
51
- # Montage into a single demo image. Use a white background so
52
- # there won't be any problems with transparency in the browser.
53
- result = results.montage do
54
- self.geometry = '270x120'
55
- self.tile = '1x4'
56
- self.background_color = 'black'
57
- end
58
- result.write('wet_floor.gif')
@@ -1,26 +0,0 @@
1
- require 'rvg/rvg'
2
-
3
- Magick::RVG.dpi = 90
4
-
5
- TEXT_STYLES = { writing_mode: 'tb',
6
- glyph_orientation_vertical: 0,
7
- fill: 'red4',
8
- font_weight: 'bold',
9
- font_size: 16 }
10
-
11
- TEXT_STYLES2 = { writing_mode: 'tb',
12
- glyph_orientation_vertical: 90,
13
- fill: 'green',
14
- font_weight: 'bold',
15
- font_size: 16 }
16
-
17
- rvg = Magick::RVG.new(1.25.in, 7.in).viewbox(0, 0, 125, 700) do |canvas|
18
- canvas.background_fill = 'white'
19
-
20
- canvas.text(40, 15, ':glyph_orientation_vertical=0').styles(TEXT_STYLES)
21
- canvas.text(80, 25, ':glyph_orientation_vertical=90').styles(TEXT_STYLES2)
22
-
23
- canvas.rect(124, 698).styles(fill: 'none', stroke: 'blue')
24
- end
25
-
26
- rvg.draw.write('writing_mode01.gif')
@@ -1,26 +0,0 @@
1
- require 'rvg/rvg'
2
-
3
- Magick::RVG.dpi = 90
4
-
5
- TEXT_STYLES = { writing_mode: 'lr',
6
- glyph_orientation_horizontal: 0,
7
- fill: 'red4',
8
- font_weight: 'bold',
9
- font_size: 16 }
10
-
11
- TEXT_STYLES2 = { writing_mode: 'lr',
12
- glyph_orientation_horizontal: 180,
13
- fill: 'green',
14
- font_weight: 'bold',
15
- font_size: 16 }
16
-
17
- rvg = Magick::RVG.new(3.in, 1.in).viewbox(0, 0, 300, 100) do |canvas|
18
- canvas.background_fill = 'white'
19
-
20
- canvas.text(15, 40, ':glyph_orientation_horizontal=0').styles(TEXT_STYLES)
21
- canvas.text(15, 80, ':glyph_orientation_horizontal=180').styles(TEXT_STYLES2)
22
-
23
- canvas.rect(299, 99).styles(fill: 'none', stroke: 'blue')
24
- end
25
-
26
- rvg.draw.write('writing_mode02.gif')
@@ -1,2056 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
-
4
- <html xmlns="http://www.w3.org/1999/xhtml">
5
- <head>
6
- <meta name="generator" content=
7
- "HTML Tidy for Linux/x86 (vers 6 November 2007), see www.w3.org" />
8
-
9
- <title>RMagick 0.0.0: class ImageList</title>
10
- <meta http-equiv="Content-Type" content=
11
- "text/html; charset=us-ascii" />
12
- <meta name="GENERATOR" content="Quanta Plus" />
13
- <meta name="Copyright" content=
14
- "Copyright (C) 2005 by Timothy P. Hunter" />
15
- <link rel="stylesheet" type="text/css" href="css/doc.css" />
16
- <script type="text/javascript" src="scripts/doc.js">
17
- </script>
18
- <script type="text/javascript" src="scripts/doc.js">
19
- </script>
20
- </head>
21
-
22
- <body>
23
- <h6 id="header">RMagick 0.0.0 User's Guide and Reference</h6>
24
-
25
- <div class="nav">
26
- &laquo;&nbsp;<a href="magick.html">Prev</a> | <a href=
27
- "index.html">Contents</a> | <a href=
28
- "imageattrs.html">Next</a>&nbsp;&raquo;
29
- </div>
30
-
31
- <h1>class ImageList<br />
32
- <span class="mixin">mixes in Comparable, Enumerable</span></h1>
33
-
34
- <div id="toc">
35
- <h2>Table of Contents</h2>
36
-
37
- <h3>class methods</h3>
38
-
39
- <ul>
40
- <li><a href="#new">new</a></li>
41
- </ul>
42
-
43
- <h3>attributes</h3>
44
-
45
- <ul>
46
- <li><a href="#delay_eq">delay=</a></li>
47
-
48
- <li><a href="#iterations_eq">iterations=</a></li>
49
-
50
- <li><a href="#length">length</a></li>
51
-
52
- <li><a href="#scene">scene, scene=</a></li>
53
-
54
- <li><a href="#ticks_per_second_eq">ticks_per_second=</a></li>
55
- </ul>
56
-
57
- <h3>instance methods</h3>
58
-
59
- <div class="toccol">
60
- <ul>
61
- <li><a href="#array_methods">Array methods</a></li>
62
-
63
- <li><a href="#spaceship">&lt;=&gt;</a></li>
64
-
65
- <li><a href="#animate">animate</a></li>
66
-
67
- <li><a href="#append">append</a></li>
68
-
69
- <li><a href="#average">average</a></li>
70
-
71
- <li><a href="#clone">clone</a></li>
72
-
73
- <li><a href="#coalesce">coalesce</a></li>
74
-
75
- <li><a href="#composite_layers">composite_layers</a></li>
76
-
77
- <li><a href="#copy">copy</a></li>
78
-
79
- <li><a href="#cur_image">cur_image</a></li>
80
- </ul>
81
- </div>
82
-
83
- <div class="toccol">
84
- <ul>
85
- <li><a href="#deconstruct">deconstruct</a></li>
86
-
87
- <li><a href="#dup">dup</a></li>
88
-
89
- <li><a href="#display">display</a></li>
90
-
91
- <li><a href="#flatten_images">flatten_images</a></li>
92
-
93
- <li><a href="#from_blob">from_blob</a></li>
94
-
95
- <li><a href="#fx">fx</a></li>
96
-
97
- <li><a href="#inspect">inspect</a></li>
98
-
99
- <li><a href="#map">map</a></li>
100
-
101
- <li><a href="#montage">montage</a></li>
102
-
103
- <li><a href="#morph">morph</a></li>
104
- </ul>
105
- </div>
106
-
107
- <div class="toccol">
108
- <ul>
109
- <li><a href="#mosaic">mosaic</a></li>
110
-
111
- <li><a href="#new_image">new_image</a></li>
112
-
113
- <li><a href="#optimize_layers">optimize_layers</a></li>
114
-
115
- <li><a href="#ping">ping</a></li>
116
-
117
- <li><a href="#quantize">quantize</a></li>
118
-
119
- <li><a href="#read">read</a></li>
120
-
121
- <li><a href="#remap">remap</a></li>
122
-
123
- <li><a href="#to_a">to_a</a></li>
124
-
125
- <li><a href="#to_blob">to_blob</a></li>
126
-
127
- <li><a href="#write">write</a></li>
128
- </ul>
129
- </div>
130
- </div>
131
-
132
- <h2 class="methods">class methods</h2>
133
-
134
- <div class="sig">
135
- <h3 id="new">new</h3>
136
-
137
- <p>Magick::ImageList.new <span class="arg">[&nbsp;{ optional
138
- arguments }&nbsp;]</span> -&gt; <em>imagelist</em><br />
139
- Magick::ImageList.new(<span class="arg">filename[,
140
- filename...]]</span>) <span class="arg">[&nbsp;{ optional
141
- arguments }&nbsp;]</span> -&gt; <em>imagelist</em></p>
142
- </div>
143
-
144
- <div class="desc">
145
- <h4>Description</h4>
146
-
147
- <p>Creates a new imagelist. If one or more image filenames are
148
- specified, opens and reads the files, adding a new image for
149
- each image in the image file(s). Sets the scene number to the
150
- index of the last image, or <code>nil</code> if no filenames
151
- are specified.</p>
152
-
153
- <h4>Arguments</h4>
154
-
155
- <p>Zero or more image file names. You can also specify optional
156
- arguments to be used when reading the file(s) by setting
157
- <a href="info.html">Image::Info</a> attributes in the optional
158
- block.</p>
159
-
160
- <h4>Returns</h4>
161
-
162
- <p>A new imagelist. The imagelist contains an Image object for
163
- each image in the specified files. A file can contain more than
164
- one image. For example, new will create an image for each frame
165
- in an animated GIF or each layer in a multi-layer Photoshop
166
- file.</p>
167
-
168
- <h4>Example</h4>
169
- <pre>
170
- i = Magick::ImageList.new
171
- i = Magick::ImageList.new("Button_A.gif", "Cheetah.jpg")
172
- </pre>
173
- </div>
174
-
175
- <h2 class="methods">attributes</h2>
176
-
177
- <div class="sig">
178
- <h3 id="delay_eq">delay=</h3>
179
-
180
- <p><span class="arg">ilist.</span>delay=<em>n</em></p>
181
- </div>
182
-
183
- <div class="desc">
184
- <h4>Description</h4>
185
-
186
- <p>In conjunction with <a href=
187
- "#ticks_per_second_eq">ticks_per_second</a> sets the length of
188
- time between each image in an animation. The
189
- <code>delay=</code> attribute assigns the same delay to all the
190
- images in the ilist. Use <a href=
191
- "imageattrs.html#delay">Image#delay=</a> to set different delay
192
- values on individual images.</p>
193
-
194
- <h4>Arguments</h4>
195
-
196
- <p>An integer value representing the number of ticks that must
197
- elapse between each image in an animation.</p>
198
-
199
- <h4>Returns</h4>
200
-
201
- <p>self</p>
202
-
203
- <h4>Example</h4>
204
- <pre>
205
- ilist.delay = 20 # delay 1/5 of a second between images.
206
- </pre>
207
-
208
- <h4>See also</h4>
209
-
210
- <p><a href="imageattrs.html#delay">Image#delay=</a></p>
211
- </div>
212
-
213
- <div class="sig">
214
- <h3 id="iterations_eq">iterations=</h3>
215
-
216
- <p><span class="arg">ilist.</span>iterations=<em>n</em></p>
217
- </div>
218
-
219
- <div class="desc">
220
- <h4>Description</h4>
221
-
222
- <p>Sets the number of times an animated image should loop.</p>
223
-
224
- <p>The <a href="#animate">animate</a> method and the
225
- ImageMagick animate command does not respect this number. Both
226
- will repeat the animation until you stop them. Mozilla (and
227
- presumably Netscape) do respect the value..</p>
228
-
229
- <h4>Arguments</h4>
230
-
231
- <p>The number of iterations.</p>
232
-
233
- <h4>Returns</h4>
234
-
235
- <p>self</p>
236
-
237
- <h4>Example</h4>
238
- <pre>
239
- ilist.iterations = 10
240
- </pre>
241
- </div>
242
-
243
- <div class="sig">
244
- <h3 id="length">length</h3>
245
-
246
- <p><span class="arg">ilist.</span>length -&gt;
247
- <em>integer</em></p>
248
- </div>
249
-
250
- <div class="desc">
251
- <h4>Description</h4>
252
-
253
- <p>Returns the number of images in the imagelist.</p>
254
-
255
- <h4>Example</h4>
256
- <pre>
257
- i = Magick::ImageList.new("images/Button_A.gif", "images/Button_B.gif")
258
- i.length &raquo; 2
259
- </pre>
260
- </div>
261
-
262
- <div class="sig">
263
- <h3 id="scene">scene, scene=</h3>
264
-
265
- <p><span class="arg">ilist</span>.scene -&gt;
266
- <em>integer</em><br />
267
- <span class="arg">ilist</span>.scene = <em>integer</em></p>
268
- </div>
269
-
270
- <div class="desc">
271
- <h4>Description</h4>
272
-
273
- <p>Get/set the current <em>scene number</em>. The scene number
274
- indicates the image to which <a href="image1.html">Image</a>
275
- methods are sent.</p>
276
-
277
- <h4>Example</h4>
278
- <pre>
279
- ilist.scene = 10
280
- ilist.scene &raquo; 10
281
- </pre>
282
- </div>
283
-
284
- <div class="sig">
285
- <h3 id="ticks_per_second_eq">ticks_per_second=</h3>
286
-
287
- <p><span class="arg">ilist</span>.ticks_per_second =
288
- <em>integer</em></p>
289
- </div>
290
-
291
- <div class="desc">
292
- <h4>Description</h4>
293
-
294
- <p>Used in conjunction with <a href="#delay_eq">delay</a> to
295
- establish the elapsed time between frames in an animation. By
296
- default the number of ticks per second is 100.</p>
297
-
298
- <h4>Example</h4>
299
- <pre>
300
- ilist.ticks_per_second = 1000
301
- </pre>
302
- </div>
303
-
304
- <h2 class="methods">instance methods</h2>
305
-
306
- <div class="sig">
307
- <h3 id="array_methods">Array methods</h3>
308
-
309
- <p>&nbsp;</p>
310
- </div>
311
-
312
- <div class="desc">
313
- <h4>Description</h4>
314
-
315
- <p><code>ImageList</code> delegates many methods to
316
- <code>Array</code>, so you can manipulate the images in an
317
- imagelist using almost all of the methods defined in
318
- <code>Array</code>. Typically these methods also update the
319
- scene number. The scene number will never exceed the number of
320
- images in the list, and if the imagelist contains no images the
321
- scene number will be <code>nil</code>.</p>
322
-
323
- <p>Array methods that would normally return an array return an
324
- ImageList.</p>
325
-
326
- <p>Most array methods keep the current image current. If the
327
- method moves the current image to a new position, the method
328
- updates the scene number to the new index. If the method
329
- deletes the current image, the scene number is set to the last
330
- image in the list. The following table lists the methods that
331
- do not follow these rules.</p>
332
-
333
- <table summary="array method affect on scene number" class=
334
- "simple_table">
335
- <caption>
336
- Array method behavior
337
- </caption>
338
-
339
- <thead>
340
- <tr>
341
- <th>Array method</th>
342
-
343
- <th>scene number will be...</th>
344
- </tr>
345
- </thead>
346
-
347
- <tbody>
348
- <tr>
349
- <td>&lt;&lt;</td>
350
-
351
- <td>set to index the last image in the list</td>
352
- </tr>
353
-
354
- <tr>
355
- <td>clear</td>
356
-
357
- <td>set to <code>nil</code></td>
358
- </tr>
359
-
360
- <tr>
361
- <td>concat</td>
362
-
363
- <td>set to index the last image in the list</td>
364
- </tr>
365
-
366
- <tr>
367
- <td>push</td>
368
-
369
- <td>set to index the last image in the list</td>
370
- </tr>
371
-
372
- <tr>
373
- <td>unshift</td>
374
-
375
- <td>set to 0</td>
376
- </tr>
377
- </tbody>
378
- </table>
379
-
380
- <p>Adding anything other than a image to an imagelist has
381
- undefined results. Most of the time RMagick will raise an
382
- ArgumentError exception. For example, if you call
383
- <code>collect!</code> on an imagelist you should make sure that
384
- the members of the imagelist remain images. If you need to
385
- replace images in an imagelist with non-image objects, convert
386
- the imagelist to an array with the <code>to_a</code> method,
387
- then modify the array.</p>
388
-
389
- <p>The <code>assoc</code>, <code>flatten</code>,
390
- <code>flatten!</code>, <code>join</code>, <code>pack</code>,
391
- and <code>rassoc</code> methods are not defined in the
392
- ImageList class.</p>
393
-
394
- <h4>Example</h4>
395
-
396
- <p>Add noise to a model image. Append the resulting image to
397
- the imagelist in "example". (See the <code>demo.rb</code>
398
- example.)</p>
399
- <pre>
400
- example = Magick::ImageList.new
401
- model = Magick::ImageList.new "model.miff"
402
- example &lt;&lt; model.add_noise Magick::LaplacisanNoise
403
- </pre>
404
-
405
- <h4>See also</h4>
406
-
407
- <p><a href="#scene">scene</a>, <a href="#scene">scene=</a></p>
408
- </div>
409
-
410
- <div class="sig">
411
- <h3 id="spaceship">&lt;=&gt;</h3>
412
-
413
- <p><span class="arg">ilist</span> &lt;=&gt; <span class=
414
- "arg">other_imagelist</span> -&gt; -1, 0, 1</p>
415
- </div>
416
-
417
- <div class="desc">
418
- <h4>Description</h4>
419
-
420
- <p>Compares two imagelists and returns -1, 0, or 1 if the
421
- receiver is less than, equal to, or greater than the other
422
- imagelist. The comparison between the receiver (a) and the
423
- other (b) is performed this way:</p>
424
-
425
- <ol>
426
- <li>For all images <code>n</code>, if the result of
427
- <code>a[n]&nbsp;&lt;=&gt;&nbsp;b[n]</code> is not 0 then that
428
- is the result of a&nbsp;&lt;=&gt;&nbsp;b. Individual images
429
- are compared by comparing their <a href=
430
- "image3.html#signature">signatures</a>.</li>
431
-
432
- <li>If <code>a.scene&nbsp;&lt;=&gt;&nbsp;b.scene</code> is
433
- not 0, returns the result</li>
434
-
435
- <li>Returns
436
- <code>a.length&nbsp;&lt;=&gt;&nbsp;b.length</code></li>
437
- </ol>
438
-
439
- <p><code>ImageList</code> mixes in the <code>Comparable</code>
440
- module.</p>
441
-
442
- <h4>See also</h4>
443
-
444
- <p><a href="image1.html#spaceship">Image#&lt;=&gt;</a>,
445
- <a href="image3.html#signature">signature</a></p>
446
- </div>
447
-
448
- <div class="sig">
449
- <h3 id="animate">animate</h3>
450
-
451
- <p><span class="arg">ilist.</span>animate(<span class=
452
- "arg">[delay]</span>) <span class="arg">[&nbsp;{ optional
453
- arguments }&nbsp;]</span> -&gt; <em>self</em></p>
454
- </div>
455
-
456
- <div class="desc">
457
- <h4>Description</h4>
458
-
459
- <p>Animate the images to an X Window screen. By default
460
- displays to the local screen. You can specify a different
461
- screen by assigning the name to the <code>server_name</code>
462
- attribute in the optional arguments block.</p>
463
-
464
- <h4>Returns</h4>
465
-
466
- <p>self</p>
467
-
468
- <h4>Example</h4>
469
- <pre>
470
- ilist.animate
471
- ilist.animate { self.server_name = "other:0.0" }
472
- </pre>
473
-
474
- <h4>See also</h4>
475
-
476
- <p><a href="#display">display</a></p>
477
-
478
- <h4>Note</h4>
479
-
480
- <p>The animate method is not supported on native MS
481
- Windows.</p>
482
-
483
- <h4>Magick API</h4>
484
-
485
- <p>AnimateImages</p>
486
- </div>
487
-
488
- <div class="sig">
489
- <h3 id="append">append</h3>
490
-
491
- <p><span class="arg">ilist.</span>append(<code>true</code> or
492
- <code>false</code>) -&gt; <em>image</em></p>
493
- </div>
494
-
495
- <div class="desc">
496
- <h4>Description</h4>
497
-
498
- <p>Append all the images in the imagelist, either vertically or
499
- horizontally. If the images are not of the same width, any
500
- narrow images will be expanded to fit using the background
501
- color.</p>
502
-
503
- <h4>Arguments</h4>
504
-
505
- <p>If <code>true</code>, rectangular images are stacked
506
- top-to-bottom, otherwise left-to-right.</p>
507
-
508
- <h4>Returns</h4>
509
-
510
- <p>A image composed of all the images in the imagelist.</p>
511
-
512
- <h4>Magick API</h4>
513
-
514
- <p>AppendImages</p>
515
- </div>
516
-
517
- <div class="sig">
518
- <h3 id="average">average</h3>
519
-
520
- <p><span class="arg">ilist.</span>average -&gt;
521
- <em>image</em></p>
522
- </div>
523
-
524
- <div class="desc">
525
- <h4>Description</h4>
526
-
527
- <p>Averages all the images together. Each image in the image
528
- must have the same width and height.</p>
529
-
530
- <h4>Returns</h4>
531
-
532
- <p>A single image representing the average of all the images in
533
- the imagelist.</p>
534
-
535
- <h4>Example</h4>
536
-
537
- <p class="rollover"><a href=
538
- "javascript:popup('average.rb.html')">
539
- <!-- This img tag displays the original image when the mouse is over -->
540
- <img style="display:none" id="notaveraged" onmouseout=
541
- "this.style.display='none'; averaged.style.display=''; averagedspin.style.display='';"
542
- title="Click to see the example script" src=
543
- "ex/average_before.gif" alt="average example" /><!--
544
- This img tag displays the averaged image when the mouse is not over
545
- --><img style="display:" id=
546
- "averaged" onmouseover=
547
- "this.style.display='none'; notaveraged.style.display=''; averagedspin.style.display='none';"
548
- src="ex/average_after.gif" alt="average example" /></a>
549
- <img src="ex/images/spin.gif" alt="" class="spin" style=
550
- "left:131px; display:" id="averagedspin" title=
551
- "Mouse over the example to see the 3 original images" /></p>
552
-
553
- <h4>Magick API</h4>
554
-
555
- <p>AverageImages</p>
556
- </div>
557
-
558
- <div class="sig">
559
- <h3 id="clone">clone</h3>
560
-
561
- <p><span class="arg">ilist</span>.clone -&gt;
562
- <em>other_imagelist</em></p>
563
- </div>
564
-
565
- <div class="desc">
566
- <h4>Description</h4>
567
-
568
- <p>Same as <a href="#dup">dup</a>, but the frozen state of the
569
- original is propagated to the copy.</p>
570
-
571
- <h4>Returns</h4>
572
-
573
- <p>A new imagelist</p>
574
-
575
- <h4>See also</h4>
576
-
577
- <p><a href="#copy">copy</a></p>
578
- </div>
579
-
580
- <div class="sig">
581
- <h3 id="coalesce">coalesce</h3>
582
-
583
- <p><span class="arg">ilist.</span>coalesce -&gt;
584
- <em>imagelist</em></p>
585
- </div>
586
-
587
- <div class="desc">
588
- <h4>Description</h4>
589
-
590
- <p>Merges all the images in the imagelist into a new imagelist.
591
- Each image in the new imagelist is formed by flattening all the
592
- previous images.</p>
593
-
594
- <p>The length of time between images in the new image is
595
- specified by the <a href="imageattrs.html#delay">delay</a>
596
- attribute of the input image. The position of the image on the
597
- merged images is specified by the <a href=
598
- "imageattrs.html#page">page</a> attribute of the input
599
- image.</p>
600
-
601
- <h4>Returns</h4>
602
-
603
- <p>A new imagelist</p>
604
-
605
- <h4>Example</h4>
606
-
607
- <p>This example is an animated GIF created by coalescing 25
608
- small images in a grid. Mouse over the image to start the
609
- animation.</p>
610
-
611
- <p class="rollover"><a href=
612
- "javascript:popup('coalesce.rb.html')"><img onmouseover=
613
- "this.src='ex/coalesce_anim.gif'" onmouseout=
614
- "this.src='ex/coalesce.gif'" src="ex/coalesce.gif" alt=
615
- "coalesce example" title=
616
- "Click the image to see the example script" /></a><img src=
617
- "ex/images/spin.gif" alt="" class="spin" style="left:165px"
618
- title="Mouse over the example to see the animation" /></p>
619
-
620
- <h4>See also</h4>
621
-
622
- <p><a href="#flatten_images">flatten_images</a>, <a href=
623
- "#optimize_layers">optimize_layers</a></p>
624
-
625
- <h4>Magick API</h4>
626
-
627
- <p>CoalesceImages</p>
628
- </div>
629
-
630
- <div class="sig">
631
- <h3 id="composite_layers">composite_layers</h3>
632
-
633
- <p><span class=
634
- "arg">destination_list</span>.composite_layers(<span class=
635
- "arg">source_list</span>, <span class=
636
- "arg">operator</span>=<code>OverCompositeOp</code>) -&gt;
637
- <em>imagelist</em></p>
638
- </div>
639
-
640
- <div class="desc">
641
- <h4>Description</h4>
642
-
643
- <p>An image from <span class="arg">source_list</span> is
644
- composited over an image from <span class=
645
- "arg">destination_list</span> until one list is finished. Use
646
- the <a href="imageattrs.html#geometry">geometry</a> and
647
- <a href="imageattrs.html#gravity">gravity</a> attributes of the
648
- first image in <span class="arg">destination_list</span> to
649
- position the source images over the destination images.
650
- <span class="imquote">Unlike a normal composite operation, the
651
- canvas offset is also included to the composite positioning. If
652
- one of the image lists only contains one image, that image is
653
- applied to all the images in the other image list, regardless
654
- of which list it is. In this case it is the image meta-data of
655
- the list which preserved.</span></p>
656
-
657
- <h4>Arguments</h4>
658
-
659
- <p>The optional <span class="arg">operator</span> argument
660
- specifies a <a href=
661
- "constants.html#CompositeOperator">CompositeOperator</a> to use
662
- for the compositing operations.</p>
663
-
664
- <h4>Returns</h4>
665
-
666
- <p>An imagelist</p>
667
-
668
- <h4>Example</h4>
669
-
670
- <p>This example is an animated GIF. Mouse over the image to
671
- start the animation.</p>
672
-
673
- <p class="rollover"><a href=
674
- "javascript:popup('composite_layers.rb.html')"><img onmouseover="this.src='ex/composite_layers.gif'"
675
- onmouseout="this.src='ex/composite_layers1.gif'" src=
676
- "ex/composite_layers1.gif" alt="composite_layers example"
677
- title="Click the image to see the example script" /></a><img src="ex/images/spin.gif"
678
- alt="" class="spin" style="left:105px" title=
679
- "Mouse over the example to see the animation" /></p>
680
-
681
- <h4>Notes</h4>
682
-
683
- <p>This method is equivalent to the <code>-layers
684
- Composite</code> option of ImageMagick's <code>convert</code>
685
- command. See the <a href=
686
- "http://www.imagemagick.org/Usage/anim_mods/#composite">Layers
687
- Composition</a> section in <a href=
688
- "http://www.imagemagick.org/Usage/">Examples of ImageMagick
689
- Usage</a> for more information.</p>
690
-
691
- <h4>See also</h4>
692
-
693
- <p><a href="#optimize_layers">optimize_layers</a></p>
694
- </div>
695
-
696
- <div class="sig">
697
- <h3 id="copy">copy</h3>
698
-
699
- <p><span class="arg">ilist.</span>copy -&gt;
700
- <em>other_imagelist</em></p>
701
- </div>
702
-
703
- <div class="desc">
704
- <h4>Description</h4>
705
-
706
- <p>Creates a deep copy of the imagelist. The new imagelist
707
- contains a copy of all the images in the original
708
- imagelist.</p>
709
-
710
- <h4>Returns</h4>
711
-
712
- <p>An imagelist</p>
713
-
714
- <h4>Example</h4>
715
- <pre>
716
- imagelist2 = imagelist1.copy
717
- </pre>
718
-
719
- <h4>See also</h4>
720
-
721
- <p><a href="image1.html#copy">Image#copy</a>, <a href=
722
- "#clone">clone</a>, <a href="#dup">dup</a></p>
723
- </div>
724
-
725
- <div class="sig">
726
- <h3 id="cur_image">cur_image</h3>
727
-
728
- <p><span class="arg">ilist.</span>cur_image -&gt;
729
- <em>image</em></p>
730
- </div>
731
-
732
- <div class="desc">
733
- <h4>Description</h4>
734
-
735
- <p>Retrieves the image indexed by <a href="#scene">scene</a>.
736
- Raises <code>IndexError</code> if there are no images in the
737
- list.</p>
738
-
739
- <p>Both the ImageList class and the Image class support the
740
- <code>cur_image</code> method. Of course, in the Image class,
741
- <code>cur_image</code> simply returns <code>self</code>. When a
742
- method accepts either an image or a imagelist as an argument,
743
- it sends the <code>cur_image</code> method to the argument to
744
- get the current image.</p>
745
-
746
- <h4>Returns</h4>
747
-
748
- <p>An image</p>
749
- </div>
750
-
751
- <div class="sig">
752
- <h3 id="deconstruct">deconstruct</h3>
753
-
754
- <p><span class="arg">ilist.</span>deconstruct -&gt;
755
- <em>imagelist</em></p>
756
- </div>
757
-
758
- <div class="desc">
759
- <h4>Description</h4>
760
-
761
- <p>This method constructs a new imagelist containing images
762
- that include only the changed pixels between each image and its
763
- successor. The resulting imagelist usually produces a much
764
- smaller file.</p>
765
-
766
- <p>The <code>deconstruct</code> method starts by copying the
767
- first image in the list to the output imagelist. Then, for each
768
- pair of images, <code>deconstruct</code> computes the smallest
769
- rectangle that encompasses all the changes between the first
770
- and second image and stores just the changed rectangle of the
771
- second image, along with the offset of the rectangle relative
772
- to the boundary of the first image.</p>
773
-
774
- <h4>Returns</h4>
775
-
776
- <p>A new imagelist</p>
777
-
778
- <h4>Magick API</h4>
779
-
780
- <p>DeconstructImages</p>
781
-
782
- <h4>See also</h4>
783
-
784
- <p><a href="#optimize_layers">optimize_layers</a></p>
785
- </div>
786
-
787
- <div class="sig">
788
- <h3 id="dup">dup</h3>
789
-
790
- <p><span class="arg">ilist</span>.dup -&gt;
791
- <em>other_imagelist</em></p>
792
- </div>
793
-
794
- <div class="desc">
795
- <h4>Description</h4>
796
-
797
- <p>Makes a <em>shallow</em> copy of the receiver. The image
798
- elements in the new imagelist are references to the image
799
- elements in the original imagelist, not copies.</p>
800
-
801
- <h4>See also</h4>
802
-
803
- <p><a href="#copy">copy</a>, <a href="#clone">clone</a></p>
804
- </div>
805
-
806
- <div class="sig">
807
- <h3 id="display">display</h3>
808
-
809
- <p><span class="arg">ilist.</span>display <span class=
810
- "arg">[&nbsp;{ optional arguments }&nbsp;]</span> -&gt;
811
- <em>self</em></p>
812
- </div>
813
-
814
- <div class="desc">
815
- <h4>Description</h4>
816
-
817
- <p>Displays the images in the imagelist to any X Window screen.
818
- By default displays to the local screen. You can specify a
819
- different screen by assigning the name to the
820
- <code>server_name</code> attribute in the optional arguments
821
- block.</p>
822
-
823
- <h4>Returns</h4>
824
-
825
- <p>self</p>
826
-
827
- <h4>See also</h4>
828
-
829
- <p><a href="#animate">animate</a>, <a href=
830
- "image1.html#display">Image#display</a></p>
831
-
832
- <h4>Note</h4>
833
-
834
- <p>The display method is not supported on native MS
835
- Windows.</p>
836
-
837
- <h4>Magick API</h4>
838
-
839
- <p>DisplayImages</p>
840
- </div>
841
-
842
- <div class="sig">
843
- <h3 id="flatten_images">flatten_images</h3>
844
-
845
- <p><span class="arg">ilist.</span>flatten_images -&gt;
846
- <em>image</em></p>
847
- </div>
848
-
849
- <div class="desc">
850
- <h4>Description</h4>
851
-
852
- <p>Combines all the images in the imagelist into a single image
853
- by overlaying each successive image onto the preceding images.
854
- If a image has transparent areas, the underlying image will
855
- show through. Use the <a href="imageattrs.html#page">page</a>
856
- attribute to specify the position of each image with respect to
857
- the preceding images.</p>
858
-
859
- <p class="imquote">This is useful for combining Photoshop
860
- layers into a single image.</p>
861
-
862
- <h4>Returns</h4>
863
-
864
- <p>An image</p>
865
-
866
- <h4>Example</h4>
867
-
868
- <p><a href=
869
- "javascript:popup('flatten_images.rb.html')"><img alt=
870
- "flatten_images example" src="ex/flatten_images.gif" title=
871
- "Click to see the example script" /></a></p>
872
-
873
- <h4>See also</h4>
874
-
875
- <p><a href="#coalesce">coalesce</a>, <a href=
876
- "#optimize_layers">optimize_layers</a></p>
877
-
878
- <h4>Magick API</h4>
879
-
880
- <p>MergeImageLayers with the FlattenLayer method.</p>
881
- </div>
882
-
883
- <div class="sig">
884
- <h3 id="from_blob">from_blob</h3>
885
-
886
- <p><span class="arg">ilist.</span>from_blob(blob<span class=
887
- "arg">[, blob...]</span>) <span class="arg">[&nbsp;{ optional
888
- arguments }&nbsp;]</span> -&gt; <em>self</em></p>
889
- </div>
890
-
891
- <div class="desc">
892
- <h4>Description</h4>
893
-
894
- <p>Creates images from the blob (<em>B</em>inary <em>L</em>arge
895
- <em>O</em>bjects) arguments and appends the images to the
896
- imagelist.</p>
897
-
898
- <h4>Arguments</h4>
899
-
900
- <p>A <em>blob</em> can be a string containing an image file
901
- such as a JPEG or GIF. The string can contain a multi-image
902
- file such as an animated GIF or a Photoshop image with multiple
903
- layers. A blob can also be one of the strings produced by
904
- <a href="#to_blob">to_blob</a>. Control how the image(s) are
905
- created by setting additional <a href=
906
- "info.html">Image::Info</a> attributes in the optional block
907
- argument. Useful attributes include <a href=
908
- "info.html#scene">scene</a>, <a href=
909
- "info.html#number_scenes">number_scenes</a>, and <a href=
910
- "info.html#extract">extract</a>.</p>
911
-
912
- <h4>Returns</h4>
913
-
914
- <p>An image created from the blob argument(s). The
915
- <code>scene</code> attribute is set to the last image in the
916
- imagelist.</p>
917
-
918
- <h4>Example</h4>
919
- <pre>
920
- require "rmagick"
921
-
922
- f = File.open('Cheetah.jpg')
923
- blob = f.read
924
-
925
- ilist = Magick::ImageList.new
926
- ilist.from_blob(blob)
927
- ilist.display
928
- </pre>
929
-
930
- <h4>See also</h4><a href="#to_blob">to_blob</a>, <a href=
931
- "image3.html#to_blob">Image#to_blob</a>, <a href=
932
- "image1.html#from_blob">Image.from_blob</a>
933
-
934
- <h4>Magick API</h4>
935
-
936
- <p>BlobToImageList</p>
937
- </div>
938
-
939
- <div class="sig">
940
- <h3 id="fx">fx</h3>
941
-
942
- <p><span class="arg">ilist</span> .fx(<span class=
943
- "arg">expression</span> [, <span class=
944
- "arg">channel</span>...]) -&gt; <em>image</em></p>
945
- </div>
946
-
947
- <div class="desc">
948
- <h4>Description</h4>
949
-
950
- <p>Applies the specified mathematical expression to the input
951
- images. This method corresponds to ImageMagick's <a href=
952
- "http://redux.imagemagick.org/script/fx.php">-fx</a>
953
- operator.</p>
954
-
955
- <h4>Arguments</h4>
956
-
957
- <dl>
958
- <dt>expression</dt>
959
-
960
- <dd>A mathematical expression of the form accepted by the -fx
961
- operator..</dd>
962
-
963
- <dt>channel...</dt>
964
-
965
- <dd>0 or more <a href=
966
- "constants.html#ChannelType">ChannelType</a> arguments.
967
- Specify the output channels. If no channels are specified the
968
- result is set over all channels except the opacity
969
- channel.</dd>
970
- </dl>
971
-
972
- <h4>Notes</h4>
973
-
974
- <ul>
975
- <li>Fx expressions are interpreted. Therefore this method can
976
- be quite slow depending on the complexity of the expression.
977
- Generally you will get better performance by accessing the
978
- image pixels as <a href="struct.html#Pixel">Pixel</a> objects
979
- (see <a href="image2.html#get_pixels">get_pixels</a> and
980
- <a href="image3.html#view">view</a>) and using Ruby code to
981
- perform the mathematics.</li>
982
-
983
- <li>The <code>u</code> and <code>v</code> symbols refer to
984
- the 0th and 1st image in the list. The image reference index
985
- (<code>u[2]</code> for example) works as expected. The
986
- current <a href="#scene">scene number</a> has no meaning in
987
- the context of the <code>fx</code> method.</li>
988
-
989
- <li>To specify a non-default pixel interpolation method, set
990
- the <a href=
991
- "imageattrs.html#pixel_interpolation_method">pixel_interpolation_method</a>
992
- attribute of the last image in the list.</li>
993
- </ul>
994
-
995
- <h4>Returns</h4>
996
-
997
- <p>The image created by the expression.</p>
998
-
999
- <h4>Example</h4>
1000
- <pre>
1001
- # Produce a navy blue image from a black image
1002
- imgl = Magick::ImageList.new
1003
- imgl &lt;&lt; Magick::Image.new(64, 64) {self.background_color = 'black'}
1004
-
1005
- res = imgl.fx('1/2', Magick::BlueChannel)
1006
- </pre>
1007
-
1008
- <h4>ImageMagick API</h4>
1009
-
1010
- <p>FxImageChannel</p>
1011
-
1012
- <h4>See also</h4>
1013
-
1014
- <p><a href="image2.html#get_pixels">get_pixels</a>, <a href=
1015
- "image3.html#view">view</a></p>
1016
- </div>
1017
-
1018
- <div class="sig">
1019
- <h3 id="inspect">inspect</h3>
1020
-
1021
- <p><span class="arg">ilist.</span>inspect -&gt;
1022
- <em>string</em></p>
1023
- </div>
1024
-
1025
- <div class="desc">
1026
- <h4>Description</h4>
1027
-
1028
- <p>Produces a string that describes the images in the
1029
- imagelist.</p>
1030
-
1031
- <h4>Arguments</h4>
1032
-
1033
- <h4>Returns</h4>
1034
-
1035
- <p>The returned string is a concatenation of the strings
1036
- returned by <a href="image2.html#inspect">Image#inspect</a> for
1037
- all the images in the imagelist.</p>
1038
-
1039
- <h4>Example</h4>
1040
- <pre>
1041
- i = Magick::ImageList.new("images/Button_A.gif", "images/Button_B.gif")
1042
- &raquo; [images/Button_A.gif GIF 127x120+0+0 PseudoClass 256c 8-bit 18136b
1043
- images/Button_B.gif GIF 127x120+0+0 PseudoClass 256c 8-bit 5157b]
1044
- scene=1
1045
- </pre>
1046
-
1047
- <h4>See also</h4>
1048
-
1049
- <p><a href="image2.html#inspect">Image#inspect</a></p>
1050
- </div>
1051
-
1052
- <div class="sig">
1053
- <h3 id="map">map</h3>
1054
-
1055
- <p><span class="arg">ilist</span>.map(<span class=
1056
- "arg">reference</span>, <span class="arg">dither</span>) -&gt;
1057
- <em>imagelist</em></p>
1058
- </div>
1059
-
1060
- <div class="desc">
1061
- <h4>Description</h4>
1062
-
1063
- <p>Reduces the colors in the imagelist images to the set of
1064
- colors in the <span class="arg">reference</span> image.</p>
1065
-
1066
- <h4>Arguments</h4>
1067
-
1068
- <dl>
1069
- <dt>reference</dt>
1070
-
1071
- <dd>An image or a imagelist. If an imagelist,
1072
- <code>map</code> uses the current image as the reference
1073
- image.</dd>
1074
-
1075
- <dt>dither</dt>
1076
-
1077
- <dd>if <code>true</code>, dither the mapped images.</dd>
1078
- </dl>
1079
-
1080
- <h4>Returns</h4>
1081
-
1082
- <p>A new imagelist the same length as the receiver.</p>
1083
-
1084
- <h4>Notes</h4>
1085
-
1086
- <p>This method is deprecated when using ImageMagick 6.4.3-6 and
1087
- later. Use <a href="#remap">remap</a> instead.</p>
1088
-
1089
- <h4>See also</h4>
1090
-
1091
- <p><a href="image2.html#map">Image#map</a>, <a href=
1092
- "#quantize">quantize</a></p>
1093
-
1094
- <h4>Magick API</h4>
1095
-
1096
- <p>MapImages</p>
1097
- </div>
1098
-
1099
- <div class="sig">
1100
- <h3 id="montage">montage</h3>
1101
-
1102
- <p><span class="arg">ilist.</span>montage <span class=
1103
- "arg">[&nbsp;{ optional arguments }&nbsp;]</span> -&gt;
1104
- <em>imagelist</em></p>
1105
- </div>
1106
-
1107
- <div class="desc">
1108
- <h4>Description</h4>
1109
-
1110
- <p>Creates a composite image by reducing the size of the input
1111
- images and arranging them in a grid on the background color or
1112
- texture of your choice. There are many configuration options.
1113
- For example, you can specify the number of columns and rows,
1114
- the distance between images, and include a label with each
1115
- small image (called a <em>tile</em>).</p>
1116
-
1117
- <p>All of <code>montage</code>'s configuration options are
1118
- specified by assigning values to attributes in a block
1119
- associated with the method call.</p>
1120
-
1121
- <p>As you can see in the examples below, when you assign a
1122
- value to a montage attribute you must specify <code>self</code>
1123
- as the receiver so that Ruby can distinguish the method call
1124
- from an assignment to a local variable.</p>
1125
-
1126
- <p>You may assign a <a href="struct.html#Pixel">Pixel</a>
1127
- object to any attribute that accepts a color name.</p>
1128
-
1129
- <h4>Montage attributes</h4>
1130
-
1131
- <dl>
1132
- <dt>background_color=</dt>
1133
-
1134
- <dd>The composite image background color.</dd>
1135
-
1136
- <dt>border_color=</dt>
1137
-
1138
- <dd>The tile border color.</dd>
1139
-
1140
- <dt>border_width=</dt>
1141
-
1142
- <dd>The tile border width in pixels.</dd>
1143
-
1144
- <dt>compose=</dt>
1145
-
1146
- <dd>The <a href="constants.html#CompositeOperator">composite
1147
- operator</a> to use when compositing the tile images onto the
1148
- background. The default composition operator is
1149
- <code>OverCompositeOp</code>.</dd>
1150
-
1151
- <dd><em>Hint:</em> You can use a different composite operator
1152
- for each tile by setting each image's <a href=
1153
- "imageattrs.html#compose">compose=</a> attribute to the
1154
- desired operator. In the optional arguments block, set
1155
- <code>compose</code> to UndefinedCompositeOp.</dd>
1156
-
1157
- <dt>fill=</dt>
1158
-
1159
- <dd>If the tiles have labels, the label fill color. The
1160
- default fill color is black.</dd>
1161
-
1162
- <dt>font=</dt>
1163
-
1164
- <dd>If the tiles have labels, the label font. The default
1165
- font is Helvetica.</dd>
1166
-
1167
- <dt>frame=</dt>
1168
-
1169
- <dd>
1170
- The size of an ornamental frame surrounding each tile. The
1171
- frame specification may be either a string or a <a href=
1172
- "struct.html#Geometry">Geometry</a> object. If the argument
1173
- is a string, it must have the form
1174
- <code>&lt;width&gt;x&lt;height&gt;+&lt;outer bevel
1175
- width&gt;+&lt;inner bevel width&gt;</code>. If the argument
1176
- is a Geometry object, specify the width and height of the
1177
- frame with the <code>width</code> and <code>height</code>
1178
- attributes, and specify the outer bevel width and the inner
1179
- bevel width with the <code>x</code> and <code>y</code>
1180
- attributes. The values are in pixels. For example, to
1181
- surround each tile with a frame 20 pixels wide by 20 pixels
1182
- high and a 4-pixel inner and outer bevel, use:
1183
- <pre>
1184
- self.frame = "20x20+4+4"
1185
- </pre>or
1186
- <pre>
1187
- self.frame = Magick::Geometry.new(20,20,4,4)
1188
- </pre>
1189
- </dd>
1190
-
1191
- <dd>If the tile has a label, the label is included in the
1192
- frame. The default is to have no frame.</dd>
1193
-
1194
- <dd>See <a href="image2.html#frame">Image#frame</a>.</dd>
1195
-
1196
- <dt>geometry=</dt>
1197
-
1198
- <dd>
1199
- The size of the tiles and the distance between tiles. The
1200
- value can be either a <a href=
1201
- "imusage.html#geometry">geometry string</a> or a <a href=
1202
- "struct.html#Geometry">Geometry</a> object. The geometry
1203
- string has the form:
1204
- <code>&lt;tile-width&gt;x&lt;tile-height&gt;+&lt;distance-between-columns&gt;+&lt;distance-between-rows&gt;</code>.
1205
- If you use a Geometry object, specify the tile width and
1206
- height with the <code>width</code> and <code>height</code>
1207
- attributes, and the distance between rows and distance
1208
- between columns by the <code>x</code> and <code>y</code>
1209
- attributes. To create tiles that are 130 pixels wide and
1210
- 194 pixels tall, with 10 pixels between each column of
1211
- tiles and 5 between each row, use:
1212
- <pre>
1213
- self.geometry = "130x194+10+5"
1214
- </pre>or
1215
- <pre>
1216
- self.geometry = Magick::Geometry.new(130, 194, 10, 5)
1217
- </pre>Both the geometry string and the <code>Geometry</code> object
1218
- support flags that specify additional constraints. The default
1219
- geometry is "120x120+4+3&gt;".
1220
- </dd>
1221
-
1222
- <dt>gravity=</dt>
1223
-
1224
- <dd>The <a href="constants.html#GravityType">direction</a>
1225
- used when adding the tile labels. (See <a href=
1226
- "draw.html#Draw.annotate">annotate</a>.)</dd>
1227
-
1228
- <dt>matte_color=</dt>
1229
-
1230
- <dd>The matte color. The default is #bdbdbd.</dd>
1231
-
1232
- <dt>pointsize=</dt>
1233
-
1234
- <dd>If the tiles have labels, the size of the label font in
1235
- points. The default is 12 points.</dd>
1236
-
1237
- <dt>shadow=</dt>
1238
-
1239
- <dd>If set to <code>true</code>, adds a drop shadow to each
1240
- tile. The default is <code>false</code>.</dd>
1241
-
1242
- <dt>stroke=</dt>
1243
-
1244
- <dd>If the tiles have labels, sets the stroke (outline) color
1245
- of the label text. The default is "transparent".</dd>
1246
-
1247
- <dt>texture=</dt>
1248
-
1249
- <dd>
1250
- A image to be tiled on the background of the composite
1251
- image. If present, this attribute overrides the background
1252
- color. For example, to use ImageMagick's built-in "granite"
1253
- texture as the background, use:
1254
- <pre>
1255
- self.texture = Magick::Image.read("granite:").first
1256
- </pre>
1257
-
1258
- <p>The default is no texture.</p>
1259
- </dd>
1260
-
1261
- <dt>tile=</dt>
1262
-
1263
- <dd>
1264
- The number of columns and rows to use when arranging the
1265
- tiles on the composite image. The value can be either a
1266
- string or a <a href="struct.html#Geometry">Geometry</a>
1267
- object. If the value is a string, it should have the form
1268
- <code>"&lt;columns&gt;x&lt;rows&gt;"</code>. If the value
1269
- is a Geometry object, specify the number of columns as the
1270
- <code>width</code> attribute and the number of rows as the
1271
- <code>height</code> attribute. <code>montage</code> always
1272
- generates all the rows, leaving empty cells if necessary.
1273
- To arrange the tiles 4 across and 10 down, use:
1274
- <pre>
1275
- self.tile = "4x10"
1276
- </pre>or
1277
- <pre>
1278
- self.tile = Magick::Geometry.new(4,10)
1279
- </pre>
1280
-
1281
- <p>The default is "6x4". If there are too many tiles to fit
1282
- on one composite image, <code>montage</code> creates
1283
- multiple composite images.</p>
1284
- </dd>
1285
-
1286
- <dt>title=</dt>
1287
-
1288
- <dd>Adds a title over the whole montage.</dd>
1289
- </dl>
1290
-
1291
- <h4>Tile labels</h4>
1292
-
1293
- <p>To add labels to the tiles, assign a "Label" property to
1294
- each image. The <code>montage</code> method will use the value
1295
- of the property as the label. For example,</p>
1296
- <pre>
1297
- img[2]['Label'] = "Mom's Birthday"
1298
- </pre>
1299
-
1300
- <p>See <a href="image1.html#aset">[]=</a>.</p>
1301
-
1302
- <h4>Returns</h4>
1303
-
1304
- <p>An imagelist that contains as many images as are required to
1305
- display all the tiles.</p>
1306
-
1307
- <h4>Magick API</h4>
1308
-
1309
- <p>MontageImages</p>
1310
- </div>
1311
-
1312
- <div class="sig">
1313
- <h3 id="morph">morph</h3>
1314
-
1315
- <p><span class="arg">ilist.</span>morph(<span class=
1316
- "arg">n</span>) -&gt; <em>imagelist</em></p>
1317
- </div>
1318
-
1319
- <div class="desc">
1320
- <h4>Description</h4>
1321
-
1322
- <p>Transforms a image into another image by inserting
1323
- <code>n</code> in-between images. Requires at least two images.
1324
- If more images are present, the 2nd image is transformed into
1325
- the 3rd, the 3rd to the 4th, etc.</p>
1326
-
1327
- <h4>Arguments</h4>
1328
-
1329
- <p>The number of in-between images to insert between each pair
1330
- of images.</p>
1331
-
1332
- <h4>Returns</h4>
1333
-
1334
- <p>An imagelist containing copies of the original images plus
1335
- the in-between images.</p>
1336
-
1337
- <h4>Example</h4>
1338
-
1339
- <p>This animated GIF was created by reading the "0", "1", "2"
1340
- and "3" images, then using <code>morph</code> to create 8
1341
- images between each original image. Mouse over the image to
1342
- start the animation.</p>
1343
-
1344
- <p class="rollover"><a href=
1345
- "javascript:popup('morph.rb.html')"><img onmouseover=
1346
- "this.src='ex/morph.gif'" onmouseout=
1347
- "this.src='ex/images/Button_0.gif'" src=
1348
- "ex/images/Button_0.gif" alt="morph example" title=
1349
- "Click the image to see the example script" /></a><img src=
1350
- "ex/images/spin.gif" alt="" class="spin" style="left:131px"
1351
- title="Mouse over the example to see the animation" /></p>
1352
-
1353
- <h4>Magick API</h4>
1354
-
1355
- <p>MorphImages</p>
1356
- </div>
1357
-
1358
- <div class="sig">
1359
- <h3 id="mosaic">mosaic</h3>
1360
-
1361
- <p><span class="arg">ilist.</span>mosaic -&gt;
1362
- <em>image</em></p>
1363
- </div>
1364
-
1365
- <div class="desc">
1366
- <h4>Description</h4>
1367
-
1368
- <p>Composites all the images into a single new image. The
1369
- location of each image is determined by the value of its
1370
- <a href="imageattrs.html#page">page</a> attribute.</p>
1371
-
1372
- <h4>Returns</h4>
1373
-
1374
- <p>An image</p>
1375
-
1376
- <h4>Example</h4>
1377
-
1378
- <p><a href="javascript:popup('mosaic.rb.html')"><img src=
1379
- "ex/mosaic.gif" alt="mosaic example" title=
1380
- "Click to see the example script" /></a></p>
1381
-
1382
- <h4>See also</h4><a href="#coalesce">coalesce</a>, <a href=
1383
- "#flatten_images">flatten_images</a>, <a href=
1384
- "#montage">montage</a>, <a href=
1385
- "#optimize_images">optimize_images</a>
1386
-
1387
- <h4>Magick API</h4>
1388
-
1389
- <p>MergeImageLayers with the MosaicLayer method.</p>
1390
- </div>
1391
-
1392
- <div class="sig">
1393
- <h3 id="new_image">new_image</h3>
1394
-
1395
- <p><span class="arg">ilist.</span>new_image(<span class=
1396
- "arg">columns</span>, <span class="arg">rows[, fill]</span>)
1397
- <span class="arg">[&nbsp;{ optional arguments }&nbsp;]</span>
1398
- -&gt; <em>self</em></p>
1399
- </div>
1400
-
1401
- <div class="desc">
1402
- <h4>Description</h4>
1403
-
1404
- <p>Adds a new image to the imagelist. The image can have an
1405
- optional <a href="struct.html#fill">fill</a> applied to it.</p>
1406
-
1407
- <h4>Arguments</h4>
1408
-
1409
- <p>Creates a new image with the specified number of rows and
1410
- columns. If the optional <code>fill</code> argument is used,
1411
- calls the <code>fill</code> method to fill the image.
1412
- Otherwise, the image is filled with the background color.</p>
1413
-
1414
- <p>You can set any <a href="info.html">Image::Info</a>
1415
- attributes in an associated block. These attributes supply
1416
- options to be used when creating the image. For example, you
1417
- can specify the <a href=
1418
- "imageattrs.html#background_color">background color</a> to fill
1419
- the image with (see the example), the <a href=
1420
- "imageattrs.html#depth">depth</a>, <a href=
1421
- "imageattrs.html#border_color">border color</a>, etc.</p>
1422
-
1423
- <h4>Returns</h4>
1424
-
1425
- <p>self</p>
1426
-
1427
- <h4>Example</h4>
1428
-
1429
- <p>Create a square red image.</p>
1430
- <pre>
1431
- ilist = Magick::ImageList.new
1432
- ilist.new_image(100, 100) { self.background_color = "red" }
1433
- </pre>
1434
- </div>
1435
-
1436
- <div class="sig">
1437
- <h3 id="optimize_layers">optimize_layers</h3>
1438
-
1439
- <p><span class="arg">ilist</span>.optimize_layers(<span class=
1440
- "arg">layer_method</span>) -&gt; <em>imagelist</em></p>
1441
- </div>
1442
-
1443
- <div class="desc">
1444
- <h4>Description</h4>
1445
-
1446
- <p>Optimizes or compares the images in the list. Equivalent to
1447
- the <code>-layers</code> option in ImageMagick's
1448
- <code>mogrify</code> command.</p>
1449
-
1450
- <p>The <code>optimize_layers</code> method corresponds to the
1451
- <code>-layers</code> option on ImageMagick's
1452
- <code>convert</code> and <code>mogrify</code> commands. Anthony
1453
- Thyssen's excellent <a href=
1454
- "http://www.imagemagick.org/Usage/">Examples of ImageMagick
1455
- Usage</a> site has very detailed <a href=
1456
- "http://www.imagemagick.org/Usage/anim_opt/">information and
1457
- examples</a> of the <code>-layers</code> option and and the
1458
- optimization methods .</p>
1459
-
1460
- <h4>Arguments</h4>
1461
-
1462
- <p>One of the following ImageLayerMethod enum values:</p>
1463
-
1464
- <dl>
1465
- <dt>CoalesceLayer</dt>
1466
-
1467
- <dd class="imquote">Equivalent to [<a href=
1468
- "#coalesce">coalesce</a>]. Apply the GIF disposal methods set
1469
- in the current image sequence to form a fully defined
1470
- animation sequence without, as it should be displayed.
1471
- Effectively converting a GIF animation into a 'film strip'
1472
- like animation.</dd>
1473
-
1474
- <dt>CompareAnyLayer</dt>
1475
-
1476
- <dd class="imquote">Crop the second and later frames to the
1477
- smallest rectangle that contains all the differences between
1478
- the two images. No GIF disposal methods are taken into
1479
- account. This is exactly the same as [<a href=
1480
- "#deconstruct">deconstruct</a>], and does not preserve a
1481
- animation's normal working, especially when a animation used
1482
- GIF disposal methods such as 'Previous' or 'Background'.</dd>
1483
-
1484
- <dt>CompareClearLayer</dt>
1485
-
1486
- <dd class="imquote">As [CompareAnyLayer] but crop to the
1487
- bounds of any opaque pixels which become transparent in the
1488
- second frame. That is the smallest image needed to mask or
1489
- erase pixels for the next frame.</dd>
1490
-
1491
- <dt>CompareOverlayLayer</dt>
1492
-
1493
- <dd class="imquote">As [CompareAnyLayer] but crop to pixels
1494
- that add extra color to the next image, as a result of
1495
- overlaying color pixels. That is the smallest single overlaid
1496
- image to add or change colors. This can, be used with the
1497
- -compose alpha composition method 'change-mask', to reduce
1498
- the image to just the pixels that need to be overlaid.</dd>
1499
-
1500
- <dt>DisposeLayer</dt>
1501
-
1502
- <dd class="imquote">This is like [CoalesceLayer] but shows
1503
- the look of the animation after the GIF disposal method has
1504
- been applied, before the next sub-frame image is overlaid.
1505
- That is the 'dispose' image that results from the application
1506
- of the GIF disposal method. This allows you to check what is
1507
- going wrong with a particular animation you may be
1508
- developing.</dd>
1509
-
1510
- <dt>FlattenLayer</dt>
1511
-
1512
- <dd><span class="imquote">Create a canvas the size of the
1513
- first images virtual canvas using the current background
1514
- color, and compose each image in turn onto that canvas.
1515
- Images falling outside that canvas will be clipped. Final
1516
- image will have a zero virtual canvas offset. This is usually
1517
- used as one of the final 'image layering' operations
1518
- overlaying all the prepared image layers into a final image.
1519
- For a single image this method can also be used to fillout a
1520
- virtual canvas with real pixels, or to underlay a opaque
1521
- color to remove transparency from an image.</span> This
1522
- method corresponds to <a href=
1523
- "#flatten_images">flatten_images</a>, above.</dd>
1524
-
1525
- <dt>MergeLayers</dt>
1526
-
1527
- <dd class="imquote">As [FlattenLayer] but merging all the
1528
- given image layers into a new layer image just large enough
1529
- to hold all the image without clipping or extra space. The
1530
- new image's virtual offset will prevere the position of the
1531
- new layer, even if this offset is negative. the virtual
1532
- canvas size of the first image is preserved. Caution is
1533
- advised when handling image layers with negative offsets as
1534
- few image file formats handle them correctly.</dd>
1535
-
1536
- <dt>MosaicLayer</dt>
1537
-
1538
- <dd><span class="imquote">As [FlattenLayer] but expanding the
1539
- initial canvas size of the first image so as to hold all the
1540
- image layers. However as a virtual canvas is 'locked' to the
1541
- origin, by definition, image layers with a negative offsets
1542
- will still be clipped by the top and left edges. This method
1543
- is commonly used to layout individual image using various
1544
- offset but without knowing the final canvas size. The
1545
- resulting image will, like FlattenLayer not have any virtual
1546
- offset, so can be saved to any image file format.</span> This
1547
- method corresponds to <a href="#mosaic">mosaic</a>,
1548
- above.</dd>
1549
-
1550
- <dt>OptimizeImageLayer</dt>
1551
-
1552
- <dd class="imquote">Optimize a coalesced animation into GIF
1553
- animation by reducing the number of pixels per frame as much
1554
- as possible by attempting to pick the best GIF disposal
1555
- method to use, while ensuring the result will continue to
1556
- animate properly. There is no guarantee that the best
1557
- optimization will be found. But then no reasonably fast GIF
1558
- optimization algorithm can do this. However this does seem to
1559
- do better than most other GIF frame optimizers seen.</dd>
1560
-
1561
- <dt>OptimizeLayer</dt>
1562
-
1563
- <dd class="imquote">Optimize a coalesced animation into GIF
1564
- animation using a number of general techniques. This is
1565
- currently a short cut to apply both the [OptimizeImageLayer]
1566
- and [OptimizeTransLayer] methods but will expand to include
1567
- other methods.</dd>
1568
-
1569
- <dt>OptimizePlusLayer</dt>
1570
-
1571
- <dd class="imquote">As [OptimizeImageLayer] but attempt to
1572
- improve the overall optimization by adding extra frames to
1573
- the animation, without changing the final look or timing of
1574
- the animation. The frames are added to attempt to separate
1575
- the clearing of pixels from the overlaying of new additional
1576
- pixels from one animation frame to the next. If this does not
1577
- improve the optimization (for the next frame only), it will
1578
- fall back to the results of the previous normal
1579
- [OptimizeImageLayer] technique. There is the possibility that
1580
- the change in the disposal style will result in a worsening
1581
- in the optimization of later frames, though this is unlikely.
1582
- In other words there no guarantee that it is better than the
1583
- normal 'optimize-frame' technique.</dd>
1584
-
1585
- <dt>OptimizeTransLayer</dt>
1586
-
1587
- <dd class="imquote">Given a GIF animation, replace any pixel
1588
- in the sub-frame overlay images with transparency, if it does
1589
- not change the resulting animation by more than the current
1590
- fuzz factor. This should allow a existing frame optimized GIF
1591
- animation to compress into a smaller file size due to larger
1592
- areas of one (transparent) color rather than a pattern of
1593
- multiple colors repeating the current disposed image of the
1594
- last frame.</dd>
1595
-
1596
- <dt>RemoveDupsLayer</dt>
1597
-
1598
- <dd class="imquote">Remove (and merge time delays) of
1599
- duplicate consecutive images, so as to simplify layer
1600
- overlays of coalesced animations. Usually this is a result of
1601
- using a constant time delay across the whole animation, or
1602
- after a larger animation was split into smaller
1603
- sub-animations. The duplicate frames could also have been
1604
- used as part of some frame optimization methods.</dd>
1605
-
1606
- <dt>RemoveZeroLayer</dt>
1607
-
1608
- <dd class="imquote">Remove any image with a zero time delay,
1609
- unless ALL the images have a zero time delay (and is not a
1610
- proper timed animation, a warning is then issued). In a GIF
1611
- animation, such images are usually frames which provide
1612
- partial intermediary updates between the frames that are
1613
- actually displayed to users. These frames are usually added
1614
- for improved frame optimization in GIF animations.</dd>
1615
-
1616
- <dt>TrimBoundsLayer</dt>
1617
-
1618
- <dd class="imquote">Find the minimal bounds of all the images
1619
- in the current image sequence, then adjust the offsets so all
1620
- images are contained on a minimal positive canvas. None of
1621
- the image data is modified, only the virtual canvas size and
1622
- offset. Then all the images will have the same canvas size,
1623
- and all will have a positive offset, at least one image will
1624
- touch every edge of that canvas with actual pixel data,
1625
- though that data may be transparent.</dd>
1626
- </dl>
1627
-
1628
- <p>Some of these values are not supported by older versions of
1629
- ImageMagick. To see what values are available, enter the
1630
- following code in irb:</p>
1631
- <pre>
1632
- Magick::ImageLayerMethod.values {|v| puts v}
1633
- </pre>
1634
-
1635
- <p>In releases of ImageMagick before 6.3.6, this type was
1636
- called MagickLayerMethod, so you may need to use this
1637
- instead:</p>
1638
- <pre>
1639
- Magick::MagickLayerMethod.values {|v| puts v}
1640
- </pre>
1641
-
1642
- <h4>Returns</h4>
1643
-
1644
- <p>A new imagelist</p>
1645
-
1646
- <h4>See also</h4>
1647
-
1648
- <p><a href="#composite_layers">composite_layers</a></p>
1649
-
1650
- <p><a href="#deconstruct">deconstruct</a> is an alias for
1651
- <code>optimize_layers</code> with the
1652
- <code>CompareAnyLayer</code> argument.</p>
1653
-
1654
- <p><a href="#coalesce">coalesce</a> is an alias for
1655
- <code>optimize_layers</code> with the
1656
- <code>CoalesceLayer</code> argument.</p>
1657
-
1658
- <h4>Magick API</h4>
1659
-
1660
- <p>OptimizeImageLayers, CompareImageLayers</p>
1661
- </div>
1662
-
1663
- <div class="sig">
1664
- <h3 id="ping">ping</h3>
1665
-
1666
- <p><span class="arg">ilist.</span>ping(<span class=
1667
- "arg">filename</span>[, <span class="arg">filename</span>...])
1668
- -&gt; <em>self</em><br />
1669
- <span class="arg">ilist.</span>ping(<span class=
1670
- "arg">file</span>[, <span class="arg">file</span>...]) -&gt;
1671
- <em>self</em></p>
1672
- </div>
1673
-
1674
- <div class="desc">
1675
- <h4>Description</h4>
1676
-
1677
- <p>Reads the image files and creates one or more images that
1678
- contain all the image attributes but without the pixel data. If
1679
- all you need is the image attributes, the <code>ping</code>
1680
- method is much faster and consumes less memory than <a href=
1681
- "#read"><code>read</code></a>.</p>
1682
-
1683
- <h4>Arguments</h4>
1684
-
1685
- <p>One or more image file names or open file objects.</p>
1686
-
1687
- <h4>Returns</h4>
1688
-
1689
- <p>self</p>
1690
-
1691
- <h4>Example</h4>
1692
- <pre>
1693
- ilist = Magick::ImageList.new
1694
- ilist.ping "Button_A.gif"
1695
- puts "The image has #{i.columns} columns and #{i.rows} rows." &raquo;
1696
- The image has 127 columns and 120 rows.
1697
- </pre>
1698
-
1699
- <h4>See also</h4><a href="#read">read</a>
1700
-
1701
- <h4>Magick API</h4>
1702
-
1703
- <p>PingImage</p>
1704
- </div>
1705
-
1706
- <div class="sig">
1707
- <h3 id="quantize">quantize</h3>
1708
-
1709
- <p><span class="arg">ilist.</span>quantize(nc=256,
1710
- colorspace=<code>RGBColorspace</code>,
1711
- dither=<code>RiemersmaDitherMethod</code>, tree_depth=0,
1712
- measure_error=<code>false</code>) -&gt; <em>imagelist</em></p>
1713
- </div>
1714
-
1715
- <div class="desc">
1716
- <h4>Description</h4>
1717
-
1718
- <p class="imquote">Analyzes the colors within a set of
1719
- reference images and chooses a fixed number of colors to
1720
- represent the set. The goal of the algorithm is to minimize the
1721
- difference between the input and output images while minimizing
1722
- the processing time.</p>
1723
-
1724
- <h4>Arguments</h4>
1725
-
1726
- <dl>
1727
- <dt>nc</dt>
1728
-
1729
- <dd>The maximum number of colors to use in the output images.
1730
- Must be less than or equal to <a href=
1731
- "constants.html#Miscellaneous_constants">QuantumRange</a>.</dd>
1732
-
1733
- <dt>colorspace</dt>
1734
-
1735
- <dd class="imquote">The <a href=
1736
- "constants.html#ColorspaceType">colorspace</a> to quantize
1737
- in. Color reduction, by default, takes place in the RGB color
1738
- space. Empirical evidence suggests that distances in color
1739
- spaces such as YUV or YIQ correspond to perceptual color
1740
- differences more closely than do distances in RGB space. The
1741
- Transparent color space behaves uniquely in that it preserves
1742
- the matte channel of the image if it exists.</dd>
1743
-
1744
- <dt>dither</dt>
1745
-
1746
- <dd>A <a href="constants.html#DitherMethod">DitherMethod</a>
1747
- value. See the documentation for the <a href=
1748
- "http://redux.imagemagick.org/script/command-line-options.php#dither">
1749
- ImageMagick -dither option</a> for more information.</dd>
1750
-
1751
- <dt>tree_depth</dt>
1752
-
1753
- <dd class="imquote">Specify the tree depth to use while
1754
- quantizing. The values 0 and 1 support automatic tree depth
1755
- determination. The tree depth may be forced via values
1756
- ranging from two to eight. The ideal tree depth depends on
1757
- the characteristics of the input image, and may be determined
1758
- through experimentation.</dd>
1759
-
1760
- <dt>measure_error</dt>
1761
-
1762
- <dd><span class="imquote">Calculate quantization errors when
1763
- quantizing the image.</span> Stores the results for each
1764
- image in the imagelist <a href=
1765
- "imageattrs.html#mean_error_per_pixel">mean_error_per_pixel</a>,
1766
- <a href=
1767
- "imageattrs.html#normalized_maximum_error">normalized_maximum_error</a>,
1768
- and <a href=
1769
- "imageattrs.html#normalized_mean_error">normalized_mean_error</a>
1770
- attributes. Stores the number of colors used for the image in
1771
- the <a href="imageattrs.html#total_colors">total_colors</a>
1772
- attribute.</dd>
1773
- </dl>
1774
-
1775
- <h4>Returns</h4>
1776
-
1777
- <p>A new imagelist containing quantized copies of the images in
1778
- the original image.</p>
1779
-
1780
- <h4>Example</h4>
1781
-
1782
- <p>This example shows the effect of quantizing 3 images to a
1783
- set of 16 colors in the RGB colorspace. Mouse over the image to
1784
- see the images before quantizing.</p>
1785
-
1786
- <p class="rollover"><a href=
1787
- "javascript:popup('quantize-m.rb.html')"><img src=
1788
- "ex/quantize-m_after.jpg" alt="quantize example" title=
1789
- "Click to see the example script" onmouseover=
1790
- "this.src='ex/quantize-m_before.jpg'" onmouseout=
1791
- "this.src='ex/quantize-m_after.jpg'" /></a> <img src=
1792
- "ex/images/spin.gif" alt="" class="spin" style="left: 505px;"
1793
- title="Mouse over the example to see the original image" /></p>
1794
-
1795
- <h4>See also</h4>
1796
-
1797
- <p><a href="image3.html#quantize">Image#quantize</a></p>
1798
-
1799
- <h4>Magick API</h4>
1800
-
1801
- <p>QuantizeImages</p>
1802
- </div>
1803
-
1804
- <div class="sig">
1805
- <h3 id="read">read</h3>
1806
-
1807
- <p><span class="arg">ilist.</span>read(<span class=
1808
- "arg">filename[, filename...]</span>) <span class=
1809
- "arg">[&nbsp;{ optional arguments }&nbsp;]</span> -&gt;
1810
- <em>self</em><br />
1811
- <span class="arg">ilist.</span>read(<span class="arg">file[,
1812
- file...]</span>) <span class="arg">[&nbsp;{ optional arguments
1813
- }&nbsp;]</span> -&gt; <em>self</em></p>
1814
- </div>
1815
-
1816
- <div class="desc">
1817
- <h4>Description</h4>
1818
-
1819
- <p>Reads one or more image files and adds the images to the
1820
- imagelist. After reading all the files, sets the <a href=
1821
- "#scene">scene</a> number to the last image in the list.</p>
1822
-
1823
- <p>The image files may be multi-frame (animated or layered)
1824
- files. In this case <code>read</code> adds multiple images per
1825
- file to the imagelist.</p>
1826
-
1827
- <h4>Arguments</h4>
1828
-
1829
- <p>One or more filenames or open file objects. You can also
1830
- specify optional arguments to be used when reading the file(s)
1831
- by setting <a href="info.html">Image::Info</a> attributes in
1832
- the optional block.</p>
1833
-
1834
- <h4>Returns</h4>
1835
-
1836
- <p>self</p>
1837
-
1838
- <h4>Example</h4>
1839
- <pre>
1840
- i = Magick::ImageList.new
1841
- number = '0'
1842
- 4.times do
1843
- i.read "images/Button_" + number + ".gif"
1844
- number.succ!
1845
- end
1846
- </pre>
1847
-
1848
- <p>Also see the morph.rb example and the demo.rb example.</p>
1849
-
1850
- <h4>See also</h4>
1851
-
1852
- <p><a href="image1.html#read">Image.read</a></p>
1853
-
1854
- <h4>Magick API</h4>
1855
-
1856
- <p>ReadImage</p>
1857
-
1858
- <h4>Notes</h4>
1859
-
1860
- <p>You can create images using ImageMagick's built-in formats
1861
- with the <code>read</code> method. See <a href=
1862
- "imusage.html#builtin_formats">Built-in image formats</a>.</p>
1863
- </div>
1864
-
1865
- <div class="sig">
1866
- <h3 id="remap">remap</h3>
1867
-
1868
- <p><span class="arg">ilist</span>.remap(<span class=
1869
- "arg">remap_image</span>=nil, <span class=
1870
- "arg">dither</span>=RiemersmaDitherMethod) -&gt;
1871
- <em>self</em></p>
1872
- </div>
1873
-
1874
- <div class="desc">
1875
- <h4>Description</h4>
1876
-
1877
- <p>Reduce the colors used in the imagelist to the set of colors
1878
- in <span id="arg">remap_image</span>.</p>
1879
-
1880
- <h4>Arguments</h4>
1881
-
1882
- <dl>
1883
- <dt>remap_image</dt>
1884
-
1885
- <dd>The reference image</dd>
1886
-
1887
- <dt>dither</dt>
1888
-
1889
- <dd>A <a href="constants.html#DitherMethod">DitherMethod</a>
1890
- value. RiemersmaDitherMethod is the default. To disable
1891
- dithering specify NoDitherMethod.</dd>
1892
- </dl>
1893
-
1894
- <h4>Returns</h4>
1895
-
1896
- <p>self</p>
1897
-
1898
- <h4>Example</h4>
1899
-
1900
- <p>This example shows the effect of reducing the colors used in
1901
- the apple, beach scene, and leaf images to the set of colors
1902
- used in the yellow rose image.</p>
1903
-
1904
- <p><a href="javascript:popup('remap_images.rb.html')"><img alt=
1905
- "remap_images example" src="ex/remap_images.jpg" title=
1906
- "Click to see the example script" /></a></p>
1907
-
1908
- <h4>See also</h4>
1909
-
1910
- <p><a href="image3.html#remap">Image#remap</a></p>
1911
-
1912
- <h4>Magick API</h4>
1913
-
1914
- <p>RemapImages (available in ImageMagick 6.4.3-6)</p>
1915
- </div>
1916
-
1917
- <div class="sig">
1918
- <h3 id="to_blob">to_blob</h3>
1919
-
1920
- <p><span class="arg">ilist.</span>to_blob <span class=
1921
- "arg">[&nbsp;{ optional arguments }&nbsp;]</span> -&gt;
1922
- <em>string</em></p>
1923
- </div>
1924
-
1925
- <div class="desc">
1926
- <h4>Description</h4>
1927
-
1928
- <p>Converts the images in the imagelist to a <em>blob</em>.
1929
- <span class="imquote">A blob contains data that directly
1930
- represent a particular image format in memory instead of on
1931
- disk.</span></p>
1932
-
1933
- <p>Control the format of the blob by setting <a href=
1934
- "info.html">Image::Info</a> attributes in an associated
1935
- block.</p>
1936
-
1937
- <h4>Returns</h4>
1938
-
1939
- <p>The blob in the form of a string</p>
1940
-
1941
- <h4>Example</h4>
1942
- <pre>
1943
- i = Magick::ImageList.new "birthday.png"
1944
- s = i.to_blob &raquo; a string representing the image.
1945
- </pre>
1946
-
1947
- <h4>See also</h4>
1948
-
1949
- <p><a href="#from_blob">from_blob</a>, <a href=
1950
- "image3.html#to_blob">Image#to_blob</a>, <a href=
1951
- "image1.html#from_blob">Image.from_blob</a></p>
1952
-
1953
- <h4>Magick API</h4>
1954
-
1955
- <p>ImageListToBlob</p>
1956
- </div>
1957
-
1958
- <div class="sig">
1959
- <h3 id="to_a">to_a</h3>
1960
-
1961
- <p><span class="arg">ilist</span>.to_a -&gt; <em>array</em></p>
1962
- </div>
1963
-
1964
- <div class="desc">
1965
- <h4>Description</h4>
1966
-
1967
- <p>Returns an array containing all the images in the list.</p>
1968
-
1969
- <h4>Returns</h4>
1970
-
1971
- <p>An array</p>
1972
- </div>
1973
-
1974
- <div class="sig">
1975
- <h3 id="write">write</h3>
1976
-
1977
- <p><span class="arg">ilist.</span>write(<span class=
1978
- "arg">filename</span>) <span class="arg">[&nbsp;{ optional
1979
- arguments }&nbsp;]</span> -&gt; <em>self</em><br />
1980
- <span class="arg">ilist.</span>write(<span class=
1981
- "arg">file</span>) <span class="arg">[&nbsp;{ optional
1982
- arguments }&nbsp;]</span> -&gt; <em>self</em></p>
1983
- </div>
1984
-
1985
- <div class="desc">
1986
- <h4>Description</h4>
1987
-
1988
- <p>If the image format <a href="imusage.html#formats">indicated
1989
- by the filename</a> supports multiple images per file (animated
1990
- images), <code>write</code> writes all the images in the
1991
- imagelist to a single file. Otherwise, <code>write</code>
1992
- writes each image to a separate file.</p>
1993
-
1994
- <p>Regardless of the original format, <code>write</code>
1995
- converts the images to the format specified by the
1996
- filename.</p>
1997
-
1998
- <p>If the imagelist contains more than one image and the output
1999
- format does not support multi-frame images, each image is
2000
- written to a file that has the filename you specify followed by
2001
- a period (.) and the scene number. You can change this behavior
2002
- by embedding a %d, %0Nd, %o, %0No, %x, or %0Nx printf format
2003
- specification in the file name.</p>
2004
-
2005
- <h4>Arguments</h4>
2006
-
2007
- <p>A filename or open file object. Indicate the desired image
2008
- <a href="imusage.html#formats">format</a> either by the suffix
2009
- (i.e. <code>.jpg</code>, <code>.png</code>) or the prefix
2010
- (<code>ps:</code>) to the filename. If the argument is an open
2011
- file object, you can specify a format for each image in the
2012
- list by setting its <a href="imageattrs.html#format">format</a>
2013
- attribute. (See the Notes section for <a href=
2014
- "image3.html#write">Image#write</a>.)</p>
2015
-
2016
- <p>You can also specify optional arguments by setting <a href=
2017
- "info.html">Image::Info</a> attributes in an associated
2018
- block.</p>
2019
-
2020
- <h4>Returns</h4>
2021
-
2022
- <p>self, or <code>nil</code> if the format cannot be
2023
- determined.</p>
2024
-
2025
- <h4>Example</h4>
2026
- <pre>
2027
- # The PNG format does not support multi-frame files,
2028
- # so each image is written to a separate file.
2029
- i = Magick::ImageList.new "animated.gif"
2030
- p i.length &raquo; 3 # contains 3 images
2031
- i.write "test.png" &raquo; test.png.0
2032
- &raquo; test.png.1
2033
- &raquo; test.png.2
2034
- # ImageMagick's MIFF format does support multi-frame
2035
- # files, so all 3 images are written to one file.
2036
- i.write "animated.miff" &raquo; animated.miff
2037
- </pre>
2038
-
2039
- <h4>See also</h4>
2040
-
2041
- <p><a href="image3.html#write">Image#write</a></p>
2042
-
2043
- <h4>Magick API</h4>
2044
-
2045
- <p>WriteImages</p>
2046
- </div>
2047
-
2048
- <p class="spacer">&nbsp;</p>
2049
-
2050
- <div class="nav">
2051
- &laquo;&nbsp;<a href="magick.html">Prev</a> | <a href=
2052
- "index.html">Contents</a> | <a href=
2053
- "imageattrs.html">Next</a>&nbsp;&raquo;
2054
- </div>
2055
- </body>
2056
- </html>