Module: PalletePNG
- Defined in:
- lib/pallete_png.rb,
lib/pallete_png/image.rb,
lib/pallete_png/version.rb
Defined Under Namespace
Classes: Image
Constant Summary collapse
- VERSION =
'1.0.1'
Class Method Summary collapse
-
.to_transparency(image_data) ⇒ String
The PNG image data.
Class Method Details
.to_transparency(image_data) ⇒ String
Returns The PNG image data.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/pallete_png.rb', line 10 def self.to_transparency(image_data) begin image = Image.new image_data rescue ChunkyPNG::SignatureMismatch raise Image::NotPNG end # Returns the raw image data if image is not a pallete-based PNG with transparency return image_data unless image.pallete_based? && image.transparency_chunk? image.to_truecolor_alpha end |