Skip to content

Commit

Permalink
Add new gradient and refine others
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamey J. DeOrio committed Apr 13, 2014
1 parent 5e08c3a commit 6db28fc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ usage

Usage: honeybii file.(png|gif|jpg) [options]
-p, --pixel-size PIXELS Size of image chunks to process into ascii (smaller => more detail) [default: 12]
-g, --gradient N Gradient characters [default: 0] [{0=>"@%8\#$VYx*=+:~-. "}, {1=>"8Oo:. "}, {2=>"#+: "}]
-g, --gradient N Gradient characters [default: 0] [{0=>"@%8\#$VYx*=+:~-. "}, {1=>"8Oo:. "}, {2=>"#+: "}, {3=>"01 "}]
-o, --one-to-one One-to-one shading, as opposed to relative

_Examples:_
Expand Down
2 changes: 1 addition & 1 deletion honeybii.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'honeybii'
s.version = '2.0.2'
s.version = '2.0.3'
s.date = '2014-04-12'
s.executables << 'honeybii'
s.add_runtime_dependency 'rmagick', ['~> 2.13', '>= 2.13.2']
Expand Down
7 changes: 4 additions & 3 deletions lib/honeybii/shaded_ascii.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ class << self
end

@gradients = [
['@', '%', '8', '#', '$', 'V', 'Y', 'x', '*', '=', '+', ':', '~', '-', '.', ' '],
['8', 'O', 'o', ':', '.', ' '],
['#', '+', ':', ' '],
['@', '%', '8', '#', '$', 'V', 'Y', 'x', '*', '=', '+', ':', '~', '-', '.', ' ', ' '],
['8', 'O', 'o', ':', '.', ' ', ' '],
['#', '+', ':', ' ', ' '],
['0', '1', ' ', ' '],
]

def initialize(image_filename, point_size = 12, gradient: 0, style: 'one_to_one')
Expand Down
4 changes: 2 additions & 2 deletions test/test_shaded_ascii.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def test_image_can_be_converted_to_ascii_with_different_detail_level
end

def test_image_can_use_different_gradients
image_first_gradient = ShadedAscii.new('test/images/flower_bee.jpg', gradient_level: 0)
image_last_gradient = ShadedAscii.new('test/images/flower_bee.jpg', gradient_level: ShadedAscii.gradients.length - 1)
image_first_gradient = ShadedAscii.new('test/images/flower_bee.jpg', gradient: 0)
image_last_gradient = ShadedAscii.new('test/images/flower_bee.jpg', gradient: ShadedAscii.gradients.length - 1)
refute_equal image_first_gradient.to_s, image_last_gradient.to_s
end

Expand Down

0 comments on commit 6db28fc

Please sign in to comment.