lib/vips/image.rb
# A new image is created with the same width, height, format,
# interpretation, resolution and offset as self, but with every pixel
# set to the specified value.
#
# You can pass an array to make a many-band image, or a single value to
# make a one-band image.
#
# @param value [Real, Array<Real>] value to put in each pixel
# @return [Image] constant image
A new image is created with the same width, height, format,
interpretation, resolution and offset as self, but with every pixel
set to the specified value.

You can pass an array to make a many-band image, or a single value to
make a one-band image.
A new image is created with the same width height format interpretation resolution and offset as self but with every pixel set to the specified value . You can pass an array to make a many - band image or a single value to make a one - band image .
def new_from_image value
            pixel = (Vips::Image.black(1, 1) + value).cast(format)
            image = pixel.embed 0, 0, width, height, extend: :copy
            image.copy interpretation: interpretation,
                xres: xres, yres: yres, xoffset: xoffset, yoffset: yoffset
        end
def new_from_image value pixel = ( Vips :: Image . black ( 1 , 1 ) + value ) . cast ( format ) image = pixel . embed 0 , 0 , width , height , extend : :copy image . copy interpretation : interpretation , xres : xres , yres : yres , xoffset : xoffset , yoffset : yoffset end
A new image is created with the same width, height, format,
interpretation, resolution and offset as self, but with every pixel
set to the specified value.
A new image is created with the same width height format interpretation resolution and offset as self but with every pixel set to the specified value .
None
Image
value
value to put in each pixel
value to put in each pixel