Module: Vips::Process::Quality

Defined in:
lib/vips-process/quality.rb

Instance Method Summary collapse

Instance Method Details

#quality(percent = 75) ⇒ Object

Changes quality of the image (if supported by the file format)

Parameters:

  • percent (defaults to: 75)

    Integer quality from 0 to 100



8
9
10
11
12
13
14
15
16
17
# File 'lib/vips-process/quality.rb', line 8

def quality(percent=75)
  manipulate! do |image|
    if jpeg? || @_format == JPEG
      @_format_opts ||= {}
      @_format_opts[:quality]
    end
    image
  end
  self
end