class GD2::Image::IndexedColor

Description

IndexedColor images select pixel colors indirectly through a palette of up to 256 colors. Use Image#palette to access the associated Palette object.

Public Instance Methods

merge_from(other, dst_x, dst_y, src_x, src_y, w, h, pct, gray = false) click to toggle source

Like Image#merge_from except an optional final argument can be specified to preserve the hue of the source by converting the destination pixels to grey scale before the merge.

Calls superclass method GD2::Image#merge_from
# File lib/gd2/image.rb, line 781
def merge_from(other, dst_x, dst_y, src_x, src_y, w, h, pct, gray = false)
  return super(other, dst_x, dst_y, src_x, src_y, w, h, pct) unless gray
  ::GD2::GD2FFI.send(:gdImageCopyMergeGray, image_ptr, other.image_ptr,
    dst_x.to_i, dst_y.to_i, src_x.to_i, src_y.to_i, w.to_i, h.to_i, pct.to_percent.round.to_i)
  self
end