nouns 0.1.1 → 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 +28 -32
  3. data/Rakefile +4 -4
  4. data/lib/nouns/version.rb +7 -4
  5. data/lib/nouns.rb +29 -32
  6. metadata +12 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c13e52c527c42e4392098f171cc49b906dcf1fe0ac8b942a1965eb35871cf40
4
- data.tar.gz: 5ae6f35994fc99a6905b68df3b45a93b9c2eb2f828b8b4c5318091f42c2d6748
3
+ metadata.gz: 122db864ac8f5935a4eb0ee33e15ec257b9db747c4eb14f6c612686abb34c90e
4
+ data.tar.gz: 4237a5933be7f5b6a270ccc7a3fab2d5f961f5ff0dfaa47171f9abfe8478c181
5
5
  SHA512:
6
- metadata.gz: fd8803b67ba45064a41aada0d0e6be12f0a7e1c7df518bdb911133e0534f2ccc05d47125d20dbc7d7943360a1768aae6bce2e8f5db2d14856359751060ca56cc
7
- data.tar.gz: 79aa72d8160c7aa3cae15e53c73c1a25110a58d0f3609ec0d231e18212dee9d7859d60c6bbc5d2685d4929cc0b9a9b90ac0477ef5fdb0af752607c329c196c91
6
+ metadata.gz: f04fbb163b21a797564ebf079c8b0ced40bd302916446698df7c7c9fb836daa5764160d812024c50319e61c6a8608283649685f2abb246cc2f4c359a03e3a8cd
7
+ data.tar.gz: 456fb3617c0affbbb1cace9fee794ab25e88414c4620f6bc46d6b297fbe4278bb769b07adb945e0410d1516fe22fb0919a0d140d42e0fc9eafe40dea05987047
data/README.md CHANGED
@@ -1,13 +1,13 @@
1
- The Do-It-Yourself (DIY) [Factory of Modern Originals (FoMO)](https://github.com/pixelartexchange/originals) Presents
1
+ The Do-It-Yourself (DIY) [Factory of Modern Originals (FoMO)](https://github.com/profilepic/originals) Presents
2
2
 
3
3
  # Nouns (Pixel Avatars)
4
4
 
5
- Yes, you can! 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
6
6
 
7
7
 
8
8
 
9
- * home :: [github.com/pixelartexchange/pixelart](https://github.com/pixelartexchange/pixelart)
10
- * 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)
11
11
  * gem :: [rubygems.org/gems/nouns](https://rubygems.org/gems/nouns)
12
12
  * rdoc :: [rubydoc.info/gems/nouns](http://rubydoc.info/gems/nouns)
13
13
 
@@ -35,24 +35,20 @@ noun.save( "noun1.png")
35
35
  noun.zoom(4).save( "noun1@4x.png" )
36
36
 
37
37
  ## let's add a background
38
- noun = Noun::Image.generate( 'Body Grayscale 1',
39
- 'Checker Bigwalk Rainbow',
40
- 'Head Beer',
41
- 'Glasses Square Fullblack',
42
- background: '#638596' )
38
+ noun = noun.background( '#638596' )
43
39
  noun.save( "noun1b.png")
44
40
  noun.zoom(4).save( "noun1b@4x.png" )
45
41
  ```
46
42
 
47
43
  Voila!
48
44
 
49
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun1.png)
50
- ![](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)
51
47
 
52
48
  In 4x:
53
49
 
54
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun1@4x.png)
55
- ![](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)
56
52
 
57
53
 
58
54
 
@@ -99,17 +95,17 @@ noun.zoom(4).save( "noun5@4x.png" )
99
95
 
100
96
  Voila!
101
97
 
102
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun2.png)
103
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun3.png)
104
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun4.png)
105
- ![](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)
106
102
 
107
103
  In 4x:
108
104
 
109
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun2@4x.png)
110
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun3@4x.png)
111
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/noun4@4x.png)
112
- ![](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)
113
109
 
114
110
 
115
111
  And so on.
@@ -140,18 +136,18 @@ glasses_square_black_rgb.zoom( 4 ).save( "glasses_square_black_rgb@4x.png" )
140
136
 
141
137
  Voila!
142
138
 
143
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/body_gold.png)
144
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/txt_pi.png)
145
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/head_weed.png)
146
- ![](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)
147
143
 
148
144
  In 4x:
149
145
 
150
146
 
151
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/body_gold@4x.png)
152
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/txt_pi@4x.png)
153
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/i/head_weed@4x.png)
154
- ![](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)
155
151
 
156
152
  And so on.
157
153
 
@@ -159,11 +155,11 @@ And so on.
159
155
 
160
156
  ## Appendix - All Built-In Spritesheet Attributes (32x32px)
161
157
 
162
- See the [spritesheet.csv](https://github.com/pixelartexchange/pixelart/blob/master/nouns/config/spritesheet.csv) dataset for all attribute names (w/ categories).
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).
163
159
 
164
- ![](https://github.com/pixelartexchange/pixelart/raw/master/nouns/config/spritesheet.png)
160
+ ![](https://github.com/profilepic/text-to-image/raw/master/nouns/config/spritesheet.png)
165
161
 
166
- (Source: [nouns/spritesheet.png](https://github.com/pixelartexchange/pixelart/blob/master/nouns/config/spritesheet.png))
162
+ (Source: [nouns/spritesheet.png](https://github.com/profilepic/text-to-image/blob/master/nouns/config/spritesheet.png))
167
163
 
168
164
 
169
165
 
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,10 @@
1
1
 
2
-
2
+ module Pixelart
3
+ module Module
3
4
  module Nouns
4
- MAJOR = 0
5
- MINOR = 1
6
- PATCH = 1
5
+ MAJOR = 1
6
+ MINOR = 0
7
+ PATCH = 0
7
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
8
9
 
9
10
  def self.version
@@ -18,5 +19,7 @@ module Nouns
18
19
  File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
19
20
  end
20
21
 
22
+ end # module Pixelart
23
+ end # module Module
21
24
  end # module Nouns
22
25
 
data/lib/nouns.rb CHANGED
@@ -1,56 +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
10
 
11
- module Nouns
11
+ module Noun
12
12
 
13
- def self.generator
14
- @generator ||= Pixelart::Generator.new( "#{root}/config/spritesheet.png",
15
- "#{root}/config/spritesheet.csv",
13
+ class Spritesheet
14
+
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",
16
18
  width: 32,
17
19
  height: 32 )
18
- end
20
+ end
21
+
22
+ def self.find_by( name: ) ## return archetype/attribute image by name
23
+ builtin.find_by( name: name )
24
+ end
25
+ end # class Spritesheet
26
+ ## add convenience (alternate spelling) alias - why? why not?
27
+ SpriteSheet = Spritesheet
28
+ Sheet = Spritesheet
29
+ Sprite = Spritesheet
19
30
 
20
31
 
21
32
  class Image < Pixelart::Image
22
33
 
34
+ def self.generator
35
+ @generator ||= Artfactory.use( Noun::Sheet.builtin,
36
+ image_class: Image )
37
+ end
38
+
39
+
23
40
  NAMES = ['noun', 'nouns']
24
41
  DEFAULT_ATTRIBUTES = ['Body Grayscale 1',
25
42
  'Checker Bigwalk Rainbow',
26
43
  'Head Beer',
27
44
  'Glasses Square Fullblack']
28
45
 
29
- def self.generate( *values )
30
- img = Nouns.generator.generate( *values )
31
- ## note: unwrap inner image before passing on to c'tor (requires ChunkyPNG image for now)
32
- new( 32, 32, img.image )
46
+ def self.generate( *names )
47
+ generator.generate( *names )
33
48
  end # method Image.generate
34
49
  end # class Image
35
-
36
-
37
- class Spritesheet
38
- ## note: for now class used for "namespace" only
39
- def self.find_by( name: ) ## return archetype/attribute image by name
40
- # note: pass along name as q (query string)
41
- Nouns.generator.find( name )
42
- end
43
- end # class Spritesheet
44
- ## add convenience (alternate spelling) alias - why? why not?
45
- SpriteSheet = Spritesheet
46
- Sheet = Spritesheet
47
- Sprite = Spritesheet
48
- end # module Nouns
49
-
50
-
51
- ### add some convenience shortcuts
52
- ## add singular too -why? why not?
53
- Noun = Nouns
50
+ end # module Noun
54
51
 
55
52
 
56
53
 
@@ -61,4 +58,4 @@ include Pixelart
61
58
 
62
59
 
63
60
 
64
- 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.1
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-08-03 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: []