originals 0.0.1 → 1.0.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: 0dc0b708faa79c717f62c1662f04ca5b3a92ae3af34b2b186917c06e0c671cce
4
- data.tar.gz: 588504c3aeafda0c47c24c34fdbe2a9fefb241c1ac581c31af42ea698c121570
3
+ metadata.gz: 5adec9529ef943fcc527eb54eb44390d42624d289781cc04c487d36dd3d8ce38
4
+ data.tar.gz: 3fc3c527e769b09bba90502ba308e599234b2da5543b905bbc7ef66704fdfa14
5
5
  SHA512:
6
- metadata.gz: 93401936c4cf2bd2a6771e2da58d1db3cd869d1fb9dcd0dc7174525f0ad522e09b49976e432b3dbf9ef44ab3ff1f11894ba1c840093cadb0252efb5871c1269c
7
- data.tar.gz: 99ee16f20effb783d9501202361a85737872f782e75ec96aabdfe36727f58c2b4ac174dc007a48c5a59f16317da340701e6cc81c55953efd29dcd023ca72ae14
6
+ metadata.gz: a8b5008a97f95b1817df036dcec56a200c1c24f1f01c52000719f04ae18261c1cdcf8f7b8793bfc62827f038f66246ea9aca1612f676d402fbd9add14d212826
7
+ data.tar.gz: 5f6fc0225659f145f7e535a46bf135cb91aca66906527c4774dc08fbb3ab20d75c7ff56486dbb29bdfbe819a76aa83063d3e6801b3048d0e37cc2d7ccba5da59
data/Manifest.txt CHANGED
@@ -3,5 +3,8 @@ LICENSE.md
3
3
  Manifest.txt
4
4
  README.md
5
5
  Rakefile
6
+ bin/fab
7
+ bin/fabricate
6
8
  lib/originals.rb
9
+ lib/originals/tool.rb
7
10
  lib/originals/version.rb
data/README.md CHANGED
@@ -1,18 +1,336 @@
1
- # Factory of Modern Originals (FOMO)
1
+ # Factory of Modern Originals (FoMO)
2
2
 
3
- Do-It-Yourself (DIY) Yes, You Can! Fab(criate) Your Own Unique (Pixel) Artworks w/ Text Attributes (Via Built-In Spritesheets) Incl. 2X/4X/8X Zoom for Bigger Sizes And More
3
+ Do-it-yourself (DIY) - yes, you can! - fab(criate) your own unique (pixel) artworks w/ text attributes (via built-in spritesheets) incl. 2x/4x/8x zoom for bigger sizes and more
4
4
 
5
5
 
6
+ * home :: [github.com/pixelartexchange/originals](https://github.com/pixelartexchange/originals)
7
+ * bugs :: [github.com/pixelartexchange/originals/issues](https://github.com/pixelartexchange/originals/issues)
8
+ * gem :: [rubygems.org/gems/originals](https://rubygems.org/gems/originals)
9
+ * rdoc :: [rubydoc.info/gems/originals](http://rubydoc.info/gems/originals)
6
10
 
7
11
 
8
12
 
9
13
 
14
+ ## Command-Line Usage
10
15
 
11
16
 
17
+ Use the `fab` (or `fabricate`) command line tool. Try:
12
18
 
19
+ ```
20
+ $ fab -h
21
+ ```
13
22
 
23
+ resulting in:
14
24
 
25
+ ```
26
+ Usage: fab [options] name [attribute] ...
27
+ -z, --zoom NUM Zoom factor x2, x4, x8, etc. (default: 1)
28
+ -b, --background, --bg STRING Background (default: transparent)
29
+ -i, --id NUM Unique identifier (default: none)
15
30
 
31
+ -h, --help Prints this help
32
+ ```
16
33
 
17
34
 
18
35
 
36
+ ### Punks (24x24)
37
+
38
+ _Fabricate punk character pixel art originals from text attributes (from scratch / zero) via builtin spritesheet_
39
+
40
+
41
+ Let's try:
42
+
43
+ ```
44
+ $ fab punk alien headband
45
+ ```
46
+
47
+ resulting in:
48
+
49
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/punk0.png)
50
+
51
+ Let's try the `-z/--zoom` factor 2x, 4x, 8x, etc.:
52
+
53
+ ```
54
+ $ fab --zoom=4 punk alien headband
55
+ # -or-
56
+ $ fab -z4 punk alien headband
57
+ ```
58
+
59
+ resulting in:
60
+
61
+ 4x ![](https://github.com/pixelartexchange/originals/raw/master/i/punk0@4x.png)
62
+
63
+
64
+ Let's try some more:
65
+
66
+ ```
67
+ $ fab punk male3 peak_spike goat horned_rim_glasses
68
+ $ fab punk demon heart_shades
69
+ ```
70
+
71
+ resulting in:
72
+
73
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/punk1.png)
74
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/punk2.png)
75
+
76
+ 4x (using the `--zoom=4`/`-z4` option)
77
+
78
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/punk1@4x.png)
79
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/punk2@4x.png)
80
+
81
+
82
+
83
+ Let's try the `-b/--background` option with two solid colors
84
+ (e.g. `0x638596` and `0xffbf00` - r/g/b colors in hex) and with the built-in ukraine and pride (rainbow) flag:
85
+
86
+
87
+ ```
88
+ $ fab --background=0x638596 punk male3 peak_spike goat horned_rim_glasses
89
+ # -or-
90
+ $ fab -b0x638596 punk male3 peak_spike goat horned_rim_glasses
91
+
92
+ $ fab --background=0xffbf00 punk male3 peak_spike goat horned_rim_glasses
93
+ $ fab --background=ukraine punk male3 peak_spike goat horned_rim_glasses
94
+ $ fab --background=pride punk male3 peak_spike goat horned_rim_glasses
95
+ ```
96
+
97
+ resulting in:
98
+
99
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/punk1.1.png)
100
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/punk1.2.png)
101
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/punk1.3.png)
102
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/punk1.4.png)
103
+
104
+ 4x (using the `--zoom=4`/`-z4` option)
105
+
106
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/punk1.1@4x.png)
107
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/punk1.2@4x.png)
108
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/punk1.3@4x.png)
109
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/punk1.4@4x.png)
110
+
111
+
112
+
113
+ ### Phunks (24x24)
114
+
115
+ Let's try some left-looking punks also known as Phunks - "hand-phlipped" by Philip the Intern
116
+
117
+ ```
118
+ $ fab phunk male2 spots hoodie
119
+ ```
120
+
121
+ resulting in:
122
+
123
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/phunk0.png)
124
+
125
+ 4x (using the `--zoom=4`/`-z4` option)
126
+
127
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/phunk0@4x.png)
128
+
129
+
130
+
131
+ ### Philips (24x24)
132
+
133
+ Let's try some left-looking philips (pre-configured phunk
134
+ with the built-in attributes: Male 3):
135
+
136
+ ```
137
+ $ fab philip
138
+ $ fab philip jester_hat smile
139
+ ```
140
+
141
+ resulting in:
142
+
143
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/philip0.png)
144
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/philip1.png)
145
+
146
+ 4x (using the `--zoom=4`/`-z4` option)
147
+
148
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/philip0@4x.png)
149
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/philip1@4x.png)
150
+
151
+
152
+
153
+ ### Marilyns (24x24)
154
+
155
+ Let's try some left-looking marilyns (pre-configured phunk
156
+ with the built-in attributes: Female 3, Wild Blonde, Mole, Blue Eye Shadow):
157
+
158
+ ```
159
+ $ fab marilyn
160
+ $ fab marilyn 3d_glasses
161
+ $ fab marilyn flowers earring smile
162
+ $ fab marilyn hot_lipstick big_shades
163
+
164
+ # or with some backgrounds
165
+ $ fab --background=0x638596 marilyn hot_lipstick big_shades
166
+ $ fab --background=0xffbf00 marilyn hot_lipstick big_shades
167
+ $ fab --background=ukraine marilyn hot_lipstick big_shades
168
+ $ fab --background=pride marilyn hot_lipstick big_shades
169
+ ```
170
+
171
+ resulting in:
172
+
173
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/marilyn0.png)
174
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/marilyn1.png)
175
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/marilyn3.png)
176
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/marilyn2.png)
177
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/marilyn2.1.png)
178
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/marilyn2.2.png)
179
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/marilyn2.3.png)
180
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/marilyn2.4.png)
181
+
182
+ 4x (using the `--zoom=4`/`-z4` option)
183
+
184
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/marilyn0@4x.png)
185
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/marilyn1@4x.png)
186
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/marilyn3@4x.png)
187
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/marilyn2.1@4x.png)
188
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/marilyn2.2@4x.png)
189
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/marilyn2.3@4x.png)
190
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/marilyn2.4@4x.png)
191
+
192
+
193
+ ### Shiba Inu Doge (24x24)
194
+
195
+
196
+ Let's try some shiba inu doge - much wow:
197
+
198
+
199
+ ```
200
+ $ fab doge alien headband
201
+ $ fab doge dark tiara big_shades
202
+
203
+ # -or- with some backgrounds
204
+ $ fab --background=0x638596 doge dark tiara big_shades
205
+ $ fab --background=0xffbf00 doge dark tiara big_shades
206
+ $ fab --background=ukraine doge dark tiara big_shades
207
+ $ fab --background=pride doge dark tiara big_shades
208
+ ```
209
+
210
+ resulting in:
211
+
212
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/doge0.png)
213
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/doge1.png)
214
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/doge1.1.png)
215
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/doge1.2.png)
216
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/doge1.3.png)
217
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/doge1.4.png)
218
+
219
+ 4x (using the `--zoom=4`/`-z4` option)
220
+
221
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/doge0@4x.png)
222
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/doge1@4x.png)
223
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/doge1.1@4x.png)
224
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/doge1.2@4x.png)
225
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/doge1.3@4x.png)
226
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/doge1.4@4x.png)
227
+
228
+
229
+
230
+
231
+ ### Coolcats (24x24)
232
+
233
+
234
+ Let's try some coolcats:
235
+
236
+
237
+ ```
238
+ $ fab coolcat ditto beret_red
239
+ $ fab coolcat unamused
240
+ $ fab coolcat tv_head_grey tv_face_no_signal
241
+
242
+ # -or- with some backgrounds
243
+ $ fab --background=0x638596 coolcat tv_head_grey tv_face_no_signal
244
+ $ fab --background=0xffbf00 coolcat tv_head_grey tv_face_no_signal
245
+ $ fab --background=ukraine coolcat tv_head_grey tv_face_no_signal
246
+ $ fab --background=pride coolcat tv_head_grey tv_face_no_signal
247
+ ```
248
+
249
+ resulting in:
250
+
251
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/coolcat0.png)
252
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/coolcat1.png)
253
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/coolcat2.png)
254
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/coolcat2.1.png)
255
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/coolcat2.2.png)
256
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/coolcat2.3.png)
257
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/coolcat2.4.png)
258
+
259
+ 4x (using the `--zoom=4`/`-z4` option)
260
+
261
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/coolcat0@4x.png)
262
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/coolcat1@4x.png)
263
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/coolcat2@4x.png)
264
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/coolcat2.1@4x.png)
265
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/coolcat2.2@4x.png)
266
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/coolcat2.3@4x.png)
267
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/coolcat2.4@4x.png)
268
+
269
+
270
+
271
+
272
+ ### Moonbirds / Owls (42x42)
273
+
274
+
275
+ Let's try some super-rare never-before-seen moonbirds / owls:
276
+
277
+ ```
278
+ $ fab moonbird crescent_golden beak_small_golden eyes_open_golden beanie
279
+ $ fab moonbird tabby_brown beak_small_orange eyes_open_white \
280
+ mcdonalds_red drivethru_onduty mcdonalds_shirt_old_skool
281
+
282
+ # -or- with some backgrounds
283
+ $ fab --background=0x638596 moonbird tabby_brown beak_small_orange eyes_open_white \
284
+ mcdonalds_red drivethru_onduty mcdonalds_shirt_old_skool
285
+ $ fab --background=0xffbf00 moonbird tabby_brown beak_small_orange eyes_open_white \
286
+ mcdonalds_red drivethru_onduty mcdonalds_shirt_old_skool
287
+ $ fab --background=ukraine moonbird tabby_brown beak_small_orange eyes_open_white \
288
+ mcdonalds_red drivethru_onduty mcdonalds_shirt_old_skool
289
+ $ fab --background=pride moonbird tabby_brown beak_small_orange eyes_open_white \
290
+ mcdonalds_red drivethru_onduty mcdonalds_shirt_old_skool
291
+ ```
292
+
293
+ resulting in:
294
+
295
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/moonbird0.png)
296
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/moonbird1.png)
297
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/moonbird1.1.png)
298
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/moonbird1.2.png)
299
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/moonbird1.3.png)
300
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/moonbird1.4.png)
301
+
302
+ 4x (using the `--zoom=4`/`-z4` option)
303
+
304
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/moonbird0@4x.png)
305
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/moonbird1@4x.png)
306
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/moonbird1.1@4x.png)
307
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/moonbird1.2@4x.png)
308
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/moonbird1.3@4x.png)
309
+ ![](https://github.com/pixelartexchange/originals/raw/master/i/moonbird1.4@4x.png)
310
+
311
+
312
+
313
+
314
+ And so on. Stay tuned for more original artwork series!
315
+
316
+
317
+
318
+
319
+ ## Install
320
+
321
+ Just install the gem:
322
+
323
+ $ gem install originals
324
+
325
+
326
+
327
+ ## License
328
+
329
+ The scripts are dedicated to the public domain.
330
+ Use it as you please with no restrictions whatsoever.
331
+
332
+
333
+ ## Questions? Comments?
334
+
335
+ Post them on the [CryptoPunksDev reddit](https://old.reddit.com/r/CryptoPunksDev). Thanks.
336
+
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ Hoe.spec 'originals' do
13
13
 
14
14
  self.version = Originals::VERSION
15
15
 
16
- self.summary = "originals - Do-It-Yourself (DIY) Yes, You Can! - Factory of Modern Originals (FOMO) - Fab(criate) Your Own Unique (Pixel) Artworks w/ Text Attributes (Via Built-In Spritesheets) Incl. 2X/4X/8X Zoom for Bigger Sizes And More"
16
+ self.summary = "originals - do-it-yourself (DIY) - yes, you can! - Factory of Modern Originals (FoMO) - fab(criate) your own unique (pixel) artworks w/ text attributes (via built-in spritesheets) incl. 2x/4x/8x zoom for bigger sizes and more"
17
17
  self.description = summary
18
18
 
19
19
  self.urls = { home: 'https://github.com/pixelartexchange/originals' }
@@ -27,6 +27,9 @@ Hoe.spec 'originals' do
27
27
 
28
28
  self.extra_deps = [
29
29
  ['cryptopunks'],
30
+ ['shibainus'],
31
+ ['moonbirds'],
32
+ ['coolcats'],
30
33
  ]
31
34
 
32
35
  self.licenses = ['Public Domain']
data/bin/fab ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ ###################
4
+ # == DEV TIPS:
5
+ #
6
+ # For local testing run like:
7
+ #
8
+ # ruby -Ilib bin/fab
9
+ #
10
+ # Set the executable bit in Linux. Example:
11
+ #
12
+ # % chmod a+x bin/fab
13
+ #
14
+
15
+ require 'originals'
16
+
17
+ Originals::Tool.main
data/bin/fabricate ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ ###################
4
+ # == DEV TIPS:
5
+ #
6
+ # For local testing run like:
7
+ #
8
+ # ruby -Ilib bin/fabricate
9
+ #
10
+ # Set the executable bit in Linux. Example:
11
+ #
12
+ # % chmod a+x bin/fabricate
13
+ #
14
+
15
+ require 'originals'
16
+
17
+ Originals::Tool.main
@@ -0,0 +1,85 @@
1
+ module Originals
2
+ class Tool
3
+
4
+ def self.main( args=ARGV )
5
+ puts "==> welcome to the fab(ricate) tool with args:"
6
+ pp args
7
+
8
+ options = { }
9
+ parser = OptionParser.new do |opts|
10
+
11
+ opts.on("--zoom NUM", "-z", Integer,
12
+ "Zoom factor x2, x4, x8, etc. (default: 1)") do |num|
13
+ options[ :zoom] = num
14
+ end
15
+
16
+ opts.on("--background STRING", "--bg STRING", "-b", String,
17
+ "Background (default: transparent|0x0)") do |str|
18
+ options[ :background] = str
19
+ end
20
+
21
+ opts.on("--name STRING", "-n", String,
22
+ "Base name (default: punk|phunk|marilyn|etc.)") do |str|
23
+ options[ :name] = str
24
+ end
25
+
26
+ opts.on("--id NUM", "-i", Integer,
27
+ "Unique identifier (default: none)") do |str|
28
+ options[ :id] = str
29
+ end
30
+
31
+ opts.on("-h", "--help", "Prints this help") do
32
+ puts opts
33
+ exit
34
+ end
35
+ end
36
+
37
+ parser.parse!( args )
38
+ puts "options:"
39
+ pp options
40
+
41
+ puts "args:"
42
+ pp args
43
+
44
+ if args.size < 1
45
+ puts "!! ERROR - no art series name found - use <name> <attribute>..."
46
+ puts ""
47
+ exit
48
+ end
49
+
50
+ name = args[0] ## todo/check - use collection_name/slug or such?
51
+ attributes = args[1..-1]
52
+
53
+ ## normalize name of series
54
+ ## e.g. Shiba Inu => shibainu etc.
55
+ key = name.downcase.gsub( '[ ()_-]', '' )
56
+
57
+ img = Original::Image.fabricate( key, *attributes,
58
+ background: options[ :background] )
59
+
60
+
61
+
62
+ basename = if options[:name]
63
+ "#{options[:name]}#{options[:id]}"
64
+ else
65
+ "#{key}#{options[:id]}"
66
+ end
67
+
68
+
69
+ path = if options[:zoom]
70
+ img = img.zoom( options[:zoom] )
71
+ "./#{basename}@#{options[:zoom]}x.png"
72
+ else
73
+ "./#{basename}.png"
74
+ end
75
+
76
+ puts " saving original #{name} (#{img.width}x#{img.height}) to >#{path}<..."
77
+ img.save( path )
78
+
79
+ puts "bye"
80
+ end
81
+ end # class Tool
82
+
83
+ end # module Originals
84
+
85
+
@@ -1,10 +1,9 @@
1
1
 
2
2
 
3
3
  module Originals
4
-
5
- MAJOR = 0
4
+ MAJOR = 1
6
5
  MINOR = 0
7
- PATCH = 1
6
+ PATCH = 0
8
7
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
8
 
10
9
  def self.version
data/lib/originals.rb CHANGED
@@ -1,8 +1,193 @@
1
1
  ## 3rd party libs
2
+ require 'cryptopunks'
3
+ require 'shibainus'
4
+ require 'moonbirds'
5
+ require 'coolcats'
6
+
7
+
2
8
 
3
9
  ## our own code
4
10
  require 'originals/version' # note: let version always go first
5
11
 
6
12
 
13
+ ## forward define superclass for image
14
+ module Originals
15
+ class Image < Pixelart::Image; end
16
+ end
17
+
18
+
19
+ module Originals
20
+
21
+ def self.factory ## "shared" single (default) instance
22
+ @factory ||= Factory.new
23
+ end
24
+
25
+
26
+
27
+ ##
28
+ # "wrap" fabricate inside Image - why? why not?
29
+ class Image
30
+ def self.fabricate( name, *attributes, background: nil ) ## add fac alias - why? why not?
31
+ ## normalize name of series
32
+ ## e.g. Shiba Inu => shibainu etc.
33
+ key = name.downcase.gsub( '[ ()_-]', '' )
34
+
35
+ img = if ['punk', 'punks',
36
+ 'cryptopunk', 'cryptopunks'].include?( key )
37
+ Originals.factory.punk( *attributes, background: background )
38
+ elsif ['phunk', 'phunks',
39
+ 'cryptophunk', 'cryptophunks'].include?( key )
40
+ Originals.factory.phunk( *attributes, background: background )
41
+ elsif ['marilyn', 'marilyns' ].include?( key )
42
+ Originals.factory.marilyn( *attributes, background: background )
43
+ elsif ['philip', 'philips',
44
+ 'philipp', 'philipps' ].include?( key )
45
+ Originals.factory.philip( *attributes, background: background )
46
+ elsif ['doge', 'doges',
47
+ 'shiba', 'shibas',
48
+ 'shibainu', 'shibainus'].include?( key )
49
+ Originals.factory.shiba( *attributes, background: background )
50
+ elsif ['bird', 'birds',
51
+ 'moonbird', 'moonbirds',
52
+ 'owl', 'owls'].include?( key )
53
+ Originals.factory.bird( *attributes, background: background )
54
+ elsif ['coolcat', 'coolcats'].include?( key )
55
+ Originals.factory.coolcat( *attributes, background: background )
56
+ else
57
+ puts "!! ERROR; don't know how to fabricate >#{name}<; sorry"
58
+ exit 1
59
+ end
60
+ img
61
+ end
62
+ class << self
63
+ alias_method :fab, :fabricate
64
+ end
65
+ end # class Image
66
+
67
+
68
+
69
+
70
+
71
+ class Factory ## add Fabricator/Artist/Artfactory/? alias or such - why? why not?
72
+
73
+ def punk( *attributes, mirror: false, background: nil )
74
+ ## note: if no attributes passed in
75
+ ## default to ['Male 2']
76
+ attributes = ['Male 2'] if attributes.size == 0
77
+
78
+ _generate_punk( *attributes,
79
+ mirror: mirror,
80
+ background: background )
81
+ end
82
+
83
+ def phunk( *attributes, background: nil )
84
+ punk( *attributes,
85
+ mirror: true,
86
+ background: background )
87
+ end
88
+
89
+
90
+ MARILYN_ATTRIBUTES = ['Female 3', 'Wild Blonde', 'Mole',
91
+ 'Blue Eye Shadow']
92
+
93
+ def marilyn( *attributes, background: nil )
94
+ _generate_punk( *MARILYN_ATTRIBUTES,
95
+ *attributes,
96
+ mirror: true,
97
+ background: background )
98
+ end
99
+
100
+
101
+ PHILIP_ATTRIBUTES = ['Male 3']
102
+ def philip( *attributes, background: nil )
103
+ _generate_punk( *PHILIP_ATTRIBUTES,
104
+ *attributes,
105
+ mirror: true,
106
+ background: background )
107
+ end
108
+
109
+
110
+
111
+ ## add method alias doge, shiba_inu etc. - why? why not?
112
+ def shiba( *attributes, background: nil )
113
+ ## note: if no attributes passed in
114
+ ## default to ['Classic']
115
+ attributes = ['Classic'] if attributes.size == 0
116
+
117
+ doge = Shiba::Image.generate( *attributes )
118
+ doge = _background( doge, background ) if background
119
+ doge
120
+ end
121
+
122
+
123
+ ## add method alias moonbird, owl etc. - why? why not?
124
+ def bird( *attributes, background: nil )
125
+ attributes = ['Brave Glitch'] if attributes.size == 0
126
+
127
+ bird = Moonbird::Image.generate( *attributes )
128
+ bird = _background( bird, background ) if background
129
+ bird
130
+ end
131
+
132
+
133
+ def coolcat( *attributes, background: nil )
134
+ cat = Coolcat::Image.generate( *attributes )
135
+ cat = _background( cat, background ) if background
136
+ cat
137
+ end
138
+
139
+
140
+
141
+ ###
142
+ # helpers
143
+
144
+ def _generate_punk( *attributes,
145
+ mirror: false,
146
+ background: nil )
147
+ punk = Cryptopunks::Image.generate( *attributes )
148
+
149
+ punk = punk.mirror if mirror
150
+ ## note: add background as LAST step (after mirror operation)
151
+ ## that is, if mirror=true background will NOT get mirrored
152
+ punk = _background( punk, background ) if background
153
+ punk
154
+ end
155
+
156
+
157
+ def _background( base, background )
158
+ width, height = base.width, base.height
159
+
160
+ img = if background.is_a?( String ) && ['ua', 'ukraine'].include?( background.downcase )
161
+ Image.new( width, height ).ukraine
162
+ elsif background.is_a?( String ) && ['rainbow', 'pride'].include?( background.downcase )
163
+ Image.new( width, height ).pride
164
+ else
165
+ Image.new( width, width, background )
166
+ end
167
+
168
+ img2 = Image.new( width, width )
169
+ img2.compose!( img )
170
+ img2.compose!( base )
171
+ img2
172
+ end
173
+
174
+ end # class Factory
175
+
176
+
177
+ end # module Originals
178
+
179
+
180
+
181
+
182
+ require 'originals/tool'
183
+
184
+
185
+
186
+ ####
187
+ # convenience aliases / shortcuts / alternate spellings
188
+ Original = Originals
189
+
190
+
191
+
7
192
 
8
193
  puts Originals.banner # say hello
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: originals
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.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-05-29 00:00:00.000000000 Z
11
+ date: 2022-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cryptopunks
@@ -24,6 +24,48 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: shibainus
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: moonbirds
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: coolcats
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
27
69
  - !ruby/object:Gem::Dependency
28
70
  name: rdoc
29
71
  requirement: !ruby/object:Gem::Requirement
@@ -58,11 +100,13 @@ dependencies:
58
100
  - - "~>"
59
101
  - !ruby/object:Gem::Version
60
102
  version: '3.23'
61
- description: originals - Do-It-Yourself (DIY) Yes, You Can! - Factory of Modern Originals
62
- (FOMO) - Fab(criate) Your Own Unique (Pixel) Artworks w/ Text Attributes (Via Built-In
63
- Spritesheets) Incl. 2X/4X/8X Zoom for Bigger Sizes And More
103
+ description: originals - do-it-yourself (DIY) - yes, you can! - Factory of Modern
104
+ Originals (FoMO) - fab(criate) your own unique (pixel) artworks w/ text attributes
105
+ (via built-in spritesheets) incl. 2x/4x/8x zoom for bigger sizes and more
64
106
  email: wwwmake@googlegroups.com
65
- executables: []
107
+ executables:
108
+ - fab
109
+ - fabricate
66
110
  extensions: []
67
111
  extra_rdoc_files:
68
112
  - CHANGELOG.md
@@ -75,7 +119,10 @@ files:
75
119
  - Manifest.txt
76
120
  - README.md
77
121
  - Rakefile
122
+ - bin/fab
123
+ - bin/fabricate
78
124
  - lib/originals.rb
125
+ - lib/originals/tool.rb
79
126
  - lib/originals/version.rb
80
127
  homepage: https://github.com/pixelartexchange/originals
81
128
  licenses:
@@ -101,7 +148,7 @@ requirements: []
101
148
  rubygems_version: 3.3.7
102
149
  signing_key:
103
150
  specification_version: 4
104
- summary: originals - Do-It-Yourself (DIY) Yes, You Can! - Factory of Modern Originals
105
- (FOMO) - Fab(criate) Your Own Unique (Pixel) Artworks w/ Text Attributes (Via Built-In
106
- Spritesheets) Incl. 2X/4X/8X Zoom for Bigger Sizes And More
151
+ summary: originals - do-it-yourself (DIY) - yes, you can! - Factory of Modern Originals
152
+ (FoMO) - fab(criate) your own unique (pixel) artworks w/ text attributes (via built-in
153
+ spritesheets) incl. 2x/4x/8x zoom for bigger sizes and more
107
154
  test_files: []