belles 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da844972b81280cd8ba3b095121c3db2272a7e8341bf32b75f4a060e7edf7e78
4
- data.tar.gz: 4d69a8a2ac09a142ac600bf2ae2318a8f3e2ac2cd8f74edfcf3edbabe59f7125
3
+ metadata.gz: ef1d1996c5a6e1b7dc13d8f4db7cf40f01436f64add9c55436345f165938f30c
4
+ data.tar.gz: eea094d17ca930c9461b63388437ea614dcee3abb60e53de0c6e97433bb1bfbf
5
5
  SHA512:
6
- metadata.gz: 6ea5ae9bba7aaa18e28851909627720155d6cc9ed4474349463f796602c3bfc12afbe683b9da878844b69f346793779bfc6b98e1789110d287f767fbaa08ad71
7
- data.tar.gz: 65f5608fe23ee0faf64928a416a3a22c8eb7436770bff4671b828dbd8549409fc9758fed474f11dc961de85f47d85bb8e3791fb772384dfeed76507420b6427e
6
+ metadata.gz: 70bf4c94de5a2eac55f2895913afc61d1a8eb3ecdbd739916509283d372de02d95a042a8d757b98a612fbe8a3eaece1e1d063ef43e4274482ad0d7ca87c1d6f3
7
+ data.tar.gz: 40525b7c7b04b61688ebd7bfa83f35ddc8cabaf60510256ee731f3aa251e5035feb93fda76a32dc9e4554f7ab166de1056d9d3702eaf0381582a399f3f998315
data/Manifest.txt CHANGED
@@ -2,5 +2,7 @@ CHANGELOG.md
2
2
  Manifest.txt
3
3
  README.md
4
4
  Rakefile
5
+ config/spritesheet.csv
6
+ config/spritesheet.png
5
7
  lib/belles.rb
6
8
  lib/belles/version.rb
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
+ The Do-It-Yourself (DIY) [Factory of Modern Originals (FoMO)](https://github.com/pixelartexchange/originals) Presents
2
+
3
+
1
4
  # Beaux & Belles (Pixel Head Avatars)
2
5
 
3
- belles - generate your own 24×24 beau & belle (pixel) head avatars images (off chain) from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes and more
6
+ Yes, you can! Generate your own 24×24 beau & belle (pixel) head avatars images (off chain) from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes and more
4
7
 
5
8
 
6
9
 
@@ -15,7 +18,64 @@ belles - generate your own 24×24 beau & belle (pixel) head avatars images (off
15
18
  ## Usage
16
19
 
17
20
  Let's generate some super-rare never-before-seen
18
- beau & belle (pixel head avatars)...
21
+ beau & belle (pixel head avatars):
22
+
23
+
24
+ ```ruby
25
+ require 'belles'
26
+
27
+ head = Beau::Image.generate( 'Head 1', 'Shades Large Dark', 'Earring',
28
+ 'Beanie Yellow', 'Pout 1', 'Turtleneck Rust' )
29
+ head.save( "head1.png")
30
+ head.zoom(4).save( "head1@4x.png" )
31
+
32
+
33
+ head = Beau::Image.generate( 'Head 2', 'Staring Brown', 'Side Parting Golden',
34
+ 'Snap Back Pink', 'Idle 2', 'Cigarette', 'Tank Top')
35
+ head.save( "head2.png")
36
+ head.zoom(4).save( "head2@4x.png" )
37
+
38
+
39
+ head = Belle::Image.generate( 'Head 2B', 'Big Staring Brown', 'Black Lipstick',
40
+ 'Turtleneck Rust', 'Suspenders', 'Elvish Black', 'Beret Rust' )
41
+ head.save( "head3.png")
42
+ head.zoom(4).save( "head3@4x.png" )
43
+
44
+ head = Belle::Image.generate( 'Head 2B', 'Big Staring Blue', 'Top Knot Peach',
45
+ 'Hot Lipstick', 'Earring', 'Turtleneck Army', 'Suspenders', 'Chain' )
46
+ head.save( "head4.png")
47
+ head.zoom(4).save( "head4@4x.png" )
48
+ ```
49
+
50
+ Voila!
51
+
52
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/belles/i/head1.png)
53
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/belles/i/head2.png)
54
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/belles/i/head3.png)
55
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/belles/i/head4.png)
56
+
57
+ In 4x:
58
+
59
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/belles/i/head1@4x.png)
60
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/belles/i/head2@4x.png)
61
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/belles/i/head3@4x.png)
62
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/belles/i/head4@4x.png)
63
+
64
+
65
+ And so on.
66
+
67
+
68
+
69
+
70
+
71
+
72
+ ## Appendix - All Built-In Spritesheet Attributes (24x24px)
73
+
74
+ See the [spritesheet.csv](https://github.com/pixelartexchange/pixelart/blob/master/belles/config/spritesheet.csv) dataset for all attribute names (w/ categories).
75
+
76
+ ![](https://github.com/pixelartexchange/pixelart/raw/master/belles/config/spritesheet.png)
77
+
78
+ (Source: [belles/spritesheet.png](https://github.com/pixelartexchange/pixelart/blob/master/belles/config/spritesheet.png))
19
79
 
20
80
 
21
81
 
@@ -0,0 +1,124 @@
1
+ id, category, name, more_names
2
+ 0, ?, Head 1, Tan | Tan 1
3
+ 1, ?, Head 1B, Tan 2
4
+ 2, ?, Head 2, Nude | Nude 1
5
+ 3, ?, Head 2B, Nude 2
6
+ 4, ?, daft,
7
+ 5, ?, staring,
8
+ 6, ?, raised,
9
+ 7, ?, Staring Brown,
10
+ 8, ?, Raised Brown,
11
+ 9, ?, Big Staring Brown,
12
+ 10, ?, Big Raised Brown,
13
+ 11, ?, Staring Blue,
14
+ 12, ?, Raised Blue,
15
+ 13, ?, Big Staring Blue,
16
+ 14, ?, Big Raised Blue,
17
+ 15, ?, shades-dark,
18
+ 16, ?, shades-yellow,
19
+ 17, ?, shades_large-dark,
20
+ 18, ?, earring,
21
+ 19, ?, Idle 1,
22
+ 20, ?, Idle 2,
23
+ 21, ?, Pout 1,
24
+ 22, ?, Pout 2,
25
+ 23, ?, Teeth 1,
26
+ 24, ?, Teeth 2,
27
+ 25, ?, Frown 1,
28
+ 26, ?, Frown 2,
29
+ 27, ?, Smile 1,
30
+ 28, ?, Smile 2,
31
+ 29, ?, Teeth w/ Smile 1,
32
+ 30, ?, Teeth w/ Smile 2,
33
+ 31, ?, Black Lipstick,
34
+ 32, ?, Pink Lipstick,
35
+ 33, ?, Purple Lipstick,
36
+ 34, ?, Red Lipstick, Hot Lipstick
37
+ 35, ?, Smile w/ Purple Lipstick,
38
+ 36, ?, Smile w/ Red Lipstick, Smile w/ Hot Lipstick
39
+ 37, ?, Teeth w/ Smile w/ Red Lipstick, Teeth w/ Smile w/ Hot Lipstick
40
+ 38, ?, cigarette,
41
+ 39, ?, full_beard-black,
42
+ 40, ?, full_beard-chestnut,
43
+ 41, ?, goatee-black,
44
+ 42, ?, goatee-chestnut,
45
+ 43, ?, moustache-black,
46
+ 44, ?, moustache-chestnut,
47
+ 45, ?, moustache-silver_fox,
48
+ 46, ?, buzz_cut-black,
49
+ 47, ?, buzz_cut-chestnut,
50
+ 48, ?, buzz_cut-golden,
51
+ 49, ?, buzz_cut-peach,
52
+ 50, ?, buzz_cut-silver_fox,
53
+ 51, ?, dreads-black,
54
+ 52, ?, dreads-chestnut,
55
+ 53, ?, dreads-golden,
56
+ 54, ?, elvish-black,
57
+ 55, ?, elvish-chestnut,
58
+ 56, ?, elvish-golden,
59
+ 57, ?, fringe-golden,
60
+ 58, ?, fringe-peach,
61
+ 59, ?, man_bun-black,
62
+ 60, ?, man_bun-golden,
63
+ 61, ?, mid_parting-black,
64
+ 62, ?, mid_parting-chestnut,
65
+ 63, ?, mid_parting-golden,
66
+ 64, ?, mid_parting-peach,
67
+ 65, ?, mohawk-black,
68
+ 66, ?, mohawk-chestnut,
69
+ 67, ?, mohawk-golden,
70
+ 68, ?, mohawk-peach,
71
+ 69, ?, pig_tails-golden,
72
+ 70, ?, pig_tails-peach,
73
+ 71, ?, pony_tail-black,
74
+ 72, ?, pony_tail-golden,
75
+ 73, ?, pony_tail-silver_fox,
76
+ 74, ?, pulled_back-black,
77
+ 75, ?, pulled_back-golden,
78
+ 76, ?, pulled_back-silver_fox,
79
+ 77, ?, pulled_forward-black,
80
+ 78, ?, pulled_forward-chestnut,
81
+ 79, ?, pulled_forward-golden,
82
+ 80, ?, pulled_forward-peach,
83
+ 81, ?, rat_tail-black,
84
+ 82, ?, rat_tail-chestnut,
85
+ 83, ?, rat_tail-golden,
86
+ 84, ?, side_parting-black,
87
+ 85, ?, side_parting-chestnut,
88
+ 86, ?, side_parting-golden,
89
+ 87, ?, slick_back-black,
90
+ 88, ?, slick_back-chestnut,
91
+ 89, ?, slick_back-golden,
92
+ 90, ?, strand-black,
93
+ 91, ?, strand-chestnut,
94
+ 92, ?, strand-golden,
95
+ 93, ?, strand-peach,
96
+ 94, ?, swirl-beach,
97
+ 95, ?, swirl-black,
98
+ 96, ?, swirl-golden,
99
+ 97, ?, top_knot-chestnut,
100
+ 98, ?, top_knot-golden,
101
+ 99, ?, top_knot-peach,
102
+ 100, ?, under_cut-black,
103
+ 101, ?, under_cut-golden,
104
+ 102, ?, under_cut-peach,
105
+ 103, ?, beanie-army,
106
+ 104, ?, beanie-yellow,
107
+ 105, ?, beret-army,
108
+ 106, ?, beret-rust,
109
+ 107, ?, snap_back-black,
110
+ 108, ?, snap_back-pink,
111
+ 109, ?, shirt,
112
+ 110, ?, tank_top,
113
+ 111, ?, turtleneck-army,
114
+ 112, ?, turtleneck-black,
115
+ 113, ?, turtleneck-blue,
116
+ 114, ?, turtleneck-gray,
117
+ 115, ?, turtleneck-pink,
118
+ 116, ?, turtleneck-rust,
119
+ 117, ?, turtleneck-violet,
120
+ 118, ?, turtleneck-white,
121
+ 119, ?, turtleneck-yellow,
122
+ 120, ?, chain,
123
+ 121, ?, leather_jacket,
124
+ 122, ?, suspenders,
Binary file
@@ -1,10 +1,9 @@
1
1
 
2
2
 
3
3
  module Belles
4
-
5
4
  MAJOR = 0
6
- MINOR = 0
7
- PATCH = 1
5
+ MINOR = 1
6
+ PATCH = 0
8
7
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
8
 
10
9
  def self.version
data/lib/belles.rb CHANGED
@@ -26,8 +26,29 @@ module Belles
26
26
 
27
27
 
28
28
  class Image
29
+ ## before callback/patch for hats
30
+ BEFORE_PATCH = ->(img, meta) {
31
+ ## hack for hats & hair - clip head "overflow"
32
+ ## quick hack for headwear
33
+ ## cut-off/clean top overflow hair/head
34
+ if meta.name.start_with?( 'beret' ) ||
35
+ meta.name.start_with?( 'snap_back' )
36
+ img[6,4] = 0
37
+ img[7,3] = 0
38
+ puts " apply beau/belle hat & hair hack before '#{meta.name}' - clip head pixels..."
39
+ elsif meta.name.start_with?( 'beanie' ) ||
40
+ meta.name.start_with?( 'dreads' )
41
+ img[6,4] = 0
42
+ puts " apply beau/belle hat & hair hack before '#{meta.name}' - clip head pixels..."
43
+ else
44
+ # do nothing; pass through as-is
45
+ end
46
+ }
47
+
29
48
  def self.generate( *values, background: nil )
30
- img = Belles.generator.generate( *values, background: background )
49
+ img = Belles.generator.generate( *values,
50
+ background: background,
51
+ before: BEFORE_PATCH )
31
52
  ## note: unwrap inner image before passing on to c'tor (requires ChunkyPNG image for now)
32
53
  new( 24, 24, img.image )
33
54
  end # method Image.generate
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: belles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-04 00:00:00.000000000 Z
11
+ date: 2022-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pixelart
@@ -73,6 +73,8 @@ files:
73
73
  - Manifest.txt
74
74
  - README.md
75
75
  - Rakefile
76
+ - config/spritesheet.csv
77
+ - config/spritesheet.png
76
78
  - lib/belles.rb
77
79
  - lib/belles/version.rb
78
80
  homepage: https://github.com/pixelartexchange/pixelart