Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed name of sum variable to sumARGB

  • Loading branch information...
commit ff16ff90665f4d19342699192e8241820bc614a3 1 parent d76741c
@oppegard authored
Showing with 5 additions and 6 deletions.
  1. +5 −6 chunkypng.rb
View
11 chunkypng.rb
@@ -12,15 +12,14 @@
DEREZ.times do |x|
DEREZ.times do |y|
color = image[x+(width_multiple*DEREZ), y+(height_multiple*DEREZ)]
- sum.r += ChunkyPNG::Color::r(color)
- sum.g += ChunkyPNG::Color::g(color)
- sum.b += ChunkyPNG::Color::b(color)
- sum.a += ChunkyPNG::Color::a(color)
+ sumARGB.r += ChunkyPNG::Color::r(color)
+ sumARGB.g += ChunkyPNG::Color::g(color)
+ sumARGB.b += ChunkyPNG::Color::b(color)
+ sumARGB.a += ChunkyPNG::Color::a(color)
end
end
- color_avg = ChunkyPNG::Color::rgba(sum.r/SQUARE,sum.g/SQUARE,sum.b/SQUARE,sum.a/SQUARE)
- puts color_avg
+ color_avg = ChunkyPNG::Color::rgba(sumARGB.r/SQUARE,sumARGB.g/SQUARE,sumARGB.b/SQUARE,sumARGB.a/SQUARE)
# color_avg = sum/(DEREZ*DEREZ)
DEREZ.times do |x|
Please sign in to comment.
Something went wrong with that request. Please try again.