lib/songster/generator.rb
# Create a crop of the mouth bottom lip with black padding on the top
Create a crop of the mouth bottom lip with black padding on the top
Create a crop of the mouth bottom lip with black padding on the top
def create_mouth_bottom_crop(mouth)
      crop_size = "#{mouth.width}x#{mouth.chin_height+mouth.opening_size}"
      crop_location = "+#{mouth.left_x}+#{mouth.middle}"
      Commander.run!("convert #{@dir}/original.miff",
                     "-fill black -stroke black",
                     "-draw \"path '",
                     "    M #{mouth.left}",
                     "    C #{mouth.center_x},#{mouth.center_y+5}",
                     "      #{mouth.center_x},#{mouth.center_y+5}",
                     "      #{mouth.right}'",
                     "\"",
                     "-gravity northwest -background black",
                     "-splice 0x#{mouth.opening_size}+0+#{mouth.middle}",
                     "-crop #{crop_size}#{crop_location}",
                     "#{@dir}/bottom.miff")
    end
def create_mouth_bottom_crop ( mouth ) crop_size = "#{mouth.width}x#{mouth.chin_height+mouth.opening_size}" crop_location = "+#{mouth.left_x}+#{mouth.middle}" Commander . run! ( "convert #{@dir}/original.miff" , "-fill black -stroke black" , "-draw \"path '" , "    M #{mouth.left}" , "    C #{mouth.center_x},#{mouth.center_y+5}" , "      #{mouth.center_x},#{mouth.center_y+5}" , "      #{mouth.right}'" , "\"" , "-gravity northwest -background black" , "-splice 0x#{mouth.opening_size}+0+#{mouth.middle}" , "-crop #{crop_size}#{crop_location}" , "#{@dir}/bottom.miff" ) end
Create a crop of the mouth bottom lip with black padding on the top
Create a crop of the mouth bottom lip with black padding on the top
# Start line at the top left point # Draw a curve to the right point # Finish line at the right point. # Add black padding to adjust how big the mouth opens. # Crop to get the results.
mouth