nouns 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +40 -29
  3. data/Rakefile +4 -4
  4. data/lib/nouns/version.rb +6 -4
  5. data/lib/nouns.rb +30 -34
  6. metadata +12 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 05742baba4782338899527821c1ec706a34cae1f2258a08799fe048050820b73
4
- data.tar.gz: b7439f154eaf59998771fccdda5bc2ff95cfe3eb979c2e1fcdcb4c194bbc28ad
3
+ metadata.gz: 122db864ac8f5935a4eb0ee33e15ec257b9db747c4eb14f6c612686abb34c90e
4
+ data.tar.gz: 4237a5933be7f5b6a270ccc7a3fab2d5f961f5ff0dfaa47171f9abfe8478c181
5
5
  SHA512:
6
- metadata.gz: 11b91d8b8e9519df6d0a0e4632f90e08e581c8893f1ba5df57d0f23cdb2f8e66ba556e3e29314ad8894d2ba969d15bfc5b56720f4ca251d1fb59725cd7371f29
7
- data.tar.gz: dc020161eb68670069ca5f75f17b53dadb59f5afbd916b7c431d12ae0691e73c6d6c0fc886345dabdd44765841496ef328352d97328ece0d04702e9706a636a5
6
+ metadata.gz: f04fbb163b21a797564ebf079c8b0ced40bd302916446698df7c7c9fb836daa5764160d812024c50319e61c6a8608283649685f2abb246cc2f4c359a03e3a8cd
7
+ data.tar.gz: 456fb3617c0affbbb1cace9fee794ab25e88414c4620f6bc46d6b297fbe4278bb769b07adb945e0410d1516fe22fb0919a0d140d42e0fc9eafe40dea05987047
data/README.md CHANGED
@@ -1,11 +1,13 @@
1
+ The Do-It-Yourself (DIY) [Factory of Modern Originals (FoMO)](https://github.com/profilepic/originals) Presents
2
+
1
3
  # Nouns (Pixel Avatars)
2
4
 
3
- nouns - generate your own 32×32 pixel avatar images (off chain) from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes and more
5
+ Yes, you can! Generate your own 32×32 pixel avatar images (off-blockchain) from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes and more
4
6
 
5
7
 
6
8
 
7
- * home :: [github.com/pixelartexchange/pixelart](https://github.com/pixelartexchange/pixelart)
8
- * bugs :: [github.com/pixelartexchange/pixelart/issues](https://github.com/pixelartexchange/pixelart/issues)
9
+ * home :: [github.com/profilepic/text-to-image](https://github.com/profilepic/text-to-image)
10
+ * bugs :: [github.com/profilepic/text-to-image/issues](https://github.com/profilepic/text-to-image/issues)
9
11
  * gem :: [rubygems.org/gems/nouns](https://rubygems.org/gems/nouns)
10
12
  * rdoc :: [rubydoc.info/gems/nouns](http://rubydoc.info/gems/nouns)
11
13
 
@@ -33,24 +35,20 @@ noun.save( "noun1.png")
33
35
  noun.zoom(4).save( "noun1@4x.png" )
34
36
 
35
37
  ## let's add a background
36
- noun = Noun::Image.generate( 'Body Grayscale 1',
37
- 'Checker Bigwalk Rainbow',
38
- 'Head Beer',
39
- 'Glasses Square Fullblack',
40
- background: '#638596' )
38
+ noun = noun.background( '#638596' )
41
39
  noun.save( "noun1b.png")
42
40
  noun.zoom(4).save( "noun1b@4x.png" )
43
41
  ```
44
42
 
45
43
  Voila!
46
44
 
47
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun1.png)
48
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun1b.png)
45
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/noun1.png)
46
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/noun1b.png)
49
47
 
50
48
  In 4x:
51
49
 
52
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun1@4x.png)
53
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun1b@4x.png)
50
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/noun1@4x.png)
51
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/noun1b@4x.png)
54
52
 
55
53
 
56
54
 
@@ -97,17 +95,17 @@ noun.zoom(4).save( "noun5@4x.png" )
97
95
 
98
96
  Voila!
99
97
 
100
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun2.png)
101
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun3.png)
102
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun4.png)
103
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun5.png)
98
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/noun2.png)
99
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/noun3.png)
100
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/noun4.png)
101
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/noun5.png)
104
102
 
105
103
  In 4x:
106
104
 
107
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun2@4x.png)
108
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun3@4x.png)
109
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun4@4x.png)
110
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun5@4x.png)
105
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/noun2@4x.png)
106
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/noun3@4x.png)
107
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/noun4@4x.png)
108
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/noun5@4x.png)
111
109
 
112
110
 
113
111
  And so on.
@@ -138,24 +136,37 @@ glasses_square_black_rgb.zoom( 4 ).save( "glasses_square_black_rgb@4x.png" )
138
136
 
139
137
  Voila!
140
138
 
141
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/body_gold.png)
142
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/txt_pi.png)
143
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/head_weed.png)
144
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/glasses_square_black_rgb.png)
139
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/body_gold.png)
140
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/txt_pi.png)
141
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/head_weed.png)
142
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/glasses_square_black_rgb.png)
145
143
 
146
144
  In 4x:
147
145
 
148
146
 
149
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/body_gold@4x.png)
150
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/txt_pi@4x.png)
151
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/head_weed@4x.png)
152
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/glasses_square_black_rgb@4x.png)
147
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/body_gold@4x.png)
148
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/txt_pi@4x.png)
149
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/head_weed@4x.png)
150
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/i/glasses_square_black_rgb@4x.png)
153
151
 
154
152
  And so on.
155
153
 
156
154
 
157
155
 
156
+ ## Appendix - All Built-In Spritesheet Attributes (32x32px)
157
+
158
+ See the [spritesheet.csv](https://github.com/profilepic/text-to-image/blob/master/nouns/config/spritesheet.csv) dataset for all attribute names (w/ categories).
159
+
160
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/config/spritesheet.png)
161
+
162
+ (Source: [nouns/spritesheet.png](https://github.com/profilepic/text-to-image/blob/master/nouns/config/spritesheet.png))
163
+
164
+
165
+
166
+
158
167
 
159
168
  ## Questions? Comments?
160
169
 
161
- Post them on the [CryptoPunksDev reddit](https://old.reddit.com/r/CryptoPunksDev). Thanks.
170
+ Post them on the [D.I.Y. Punk (Pixel) Art reddit](https://old.reddit.com/r/DIYPunkArt). Thanks.
171
+
172
+
data/Rakefile CHANGED
@@ -11,12 +11,12 @@ end
11
11
 
12
12
  Hoe.spec 'nouns' do
13
13
 
14
- self.version = Nouns::VERSION
14
+ self.version = Pixelart::Module::Nouns::VERSION
15
15
 
16
- self.summary = "nouns - generate your own 32×32 pixel avatar images (off chain) from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes and more"
16
+ self.summary = "nouns - generate your own 32×32 pixel avatar images (off-blockchain) from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes and more"
17
17
  self.description = summary
18
18
 
19
- self.urls = { home: 'https://github.com/pixelartexchange/pixelart' }
19
+ self.urls = { home: 'https://github.com/profilepic/text-to-image' }
20
20
 
21
21
  self.author = 'Gerald Bauer'
22
22
  self.email = 'wwwmake@googlegroups.com'
@@ -26,7 +26,7 @@ Hoe.spec 'nouns' do
26
26
  self.history_file = 'CHANGELOG.md'
27
27
 
28
28
  self.extra_deps = [
29
- ['pixelart', '>= 1.3.1'],
29
+ ['artfactory', '>= 0.2.0'],
30
30
  ]
31
31
 
32
32
  self.licenses = ['Public Domain']
data/lib/nouns/version.rb CHANGED
@@ -1,9 +1,9 @@
1
1
 
2
-
2
+ module Pixelart
3
+ module Module
3
4
  module Nouns
4
-
5
- MAJOR = 0
6
- MINOR = 1
5
+ MAJOR = 1
6
+ MINOR = 0
7
7
  PATCH = 0
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
@@ -19,5 +19,7 @@ module Nouns
19
19
  File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
20
20
  end
21
21
 
22
+ end # module Pixelart
23
+ end # module Module
22
24
  end # module Nouns
23
25
 
data/lib/nouns.rb CHANGED
@@ -1,57 +1,53 @@
1
- ## 3rd party
2
- require 'pixelart/base'
1
+ ## our own "3rd" party gems
2
+ require 'artfactory/base'
3
3
 
4
4
 
5
5
 
6
6
  ## our own code
7
- require 'nouns/version' # note: let version always go first
7
+ require_relative 'nouns/version' # note: let version always go first
8
8
 
9
9
 
10
- ## forward define superclass for image
11
- module Nouns
12
- class Image < Pixelart::Image; end
13
- end
14
10
 
11
+ module Noun
15
12
 
16
- ###
17
- ## add convenience pre-configurated generatored with build-in spritesheet (see config)
18
-
19
- module Nouns
13
+ class Spritesheet
20
14
 
21
- def self.generator
22
- @generator ||= Pixelart::Generator.new( "#{root}/config/spritesheet.png",
23
- "#{root}/config/spritesheet.csv",
15
+ def self.builtin ### check: use a different name e.g. default,standard,base or such - why? why not?
16
+ @sheet ||= Pixelart::Spritesheet.read( "#{Pixelart::Module::Nouns.root}/config/spritesheet.png",
17
+ "#{Pixelart::Module::Nouns.root}/config/spritesheet.csv",
24
18
  width: 32,
25
19
  height: 32 )
26
- end
27
-
28
-
29
- class Image
30
- def self.generate( *values, background: nil )
31
- img = Nouns.generator.generate( *values, background: background )
32
- ## note: unwrap inner image before passing on to c'tor (requires ChunkyPNG image for now)
33
- new( 32, 32, img.image )
34
- end # method Image.generate
35
- end # class Image
36
-
20
+ end
37
21
 
38
- class Spritesheet
39
- ## note: for now class used for "namespace" only
40
22
  def self.find_by( name: ) ## return archetype/attribute image by name
41
- # note: pass along name as q (query string)
42
- Nouns.generator.find( name )
23
+ builtin.find_by( name: name )
43
24
  end
44
25
  end # class Spritesheet
45
26
  ## add convenience (alternate spelling) alias - why? why not?
46
27
  SpriteSheet = Spritesheet
47
28
  Sheet = Spritesheet
48
29
  Sprite = Spritesheet
49
- end # module Nouns
50
30
 
51
31
 
52
- ### add some convenience shortcuts
53
- ## add singular too -why? why not?
54
- Noun = Nouns
32
+ class Image < Pixelart::Image
33
+
34
+ def self.generator
35
+ @generator ||= Artfactory.use( Noun::Sheet.builtin,
36
+ image_class: Image )
37
+ end
38
+
39
+
40
+ NAMES = ['noun', 'nouns']
41
+ DEFAULT_ATTRIBUTES = ['Body Grayscale 1',
42
+ 'Checker Bigwalk Rainbow',
43
+ 'Head Beer',
44
+ 'Glasses Square Fullblack']
45
+
46
+ def self.generate( *names )
47
+ generator.generate( *names )
48
+ end # method Image.generate
49
+ end # class Image
50
+ end # module Noun
55
51
 
56
52
 
57
53
 
@@ -62,4 +58,4 @@ include Pixelart
62
58
 
63
59
 
64
60
 
65
- puts Nouns.banner # say hello
61
+ puts Pixelart::Module::Nouns.banner # say hello
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nouns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.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-05-20 00:00:00.000000000 Z
11
+ date: 2022-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: pixelart
14
+ name: artfactory
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.3.1
19
+ version: 0.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.3.1
26
+ version: 0.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rdoc
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,9 +58,9 @@ dependencies:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '3.23'
61
- description: nouns - generate your own 32×32 pixel avatar images (off chain) from
62
- text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes
63
- and more
61
+ description: nouns - generate your own 32×32 pixel avatar images (off-blockchain)
62
+ from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger
63
+ sizes and more
64
64
  email: wwwmake@googlegroups.com
65
65
  executables: []
66
66
  extensions: []
@@ -77,7 +77,7 @@ files:
77
77
  - config/spritesheet.png
78
78
  - lib/nouns.rb
79
79
  - lib/nouns/version.rb
80
- homepage: https://github.com/pixelartexchange/pixelart
80
+ homepage: https://github.com/profilepic/text-to-image
81
81
  licenses:
82
82
  - Public Domain
83
83
  metadata: {}
@@ -101,7 +101,7 @@ requirements: []
101
101
  rubygems_version: 3.3.7
102
102
  signing_key:
103
103
  specification_version: 4
104
- summary: nouns - generate your own 32×32 pixel avatar images (off chain) from text
105
- attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes and
106
- more
104
+ summary: nouns - generate your own 32×32 pixel avatar images (off-blockchain) from
105
+ text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes
106
+ and more
107
107
  test_files: []