smileys 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 +4 -4
- data/Manifest.txt +4 -0
- data/README.md +88 -4
- data/Rakefile +1 -3
- data/config/spritesheet_dia17-24x24.csv +18 -0
- data/config/spritesheet_dia17-24x24.png +0 -0
- data/config/spritesheet_dia20-24x24.csv +22 -0
- data/config/spritesheet_dia20-24x24.png +0 -0
- data/lib/smileys/version.rb +2 -2
- data/lib/smileys.rb +121 -4
- metadata +7 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e70fd7c1808cb80c3d6e87732638d3352ea243225a66fb4ca6b024a21639cf4
|
4
|
+
data.tar.gz: 9197c56d46cab812ea7224920389a6a1107222628f9265e970228d3d00bfc2b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ce42a8f40c60660d84a08679a6e0f242622050a6aee4a7ed4a59f21e6f33baff62e806d679bc3c3284df63073fdbf1528da55ca2b9330a7f88b18c09e07113a
|
7
|
+
data.tar.gz: 85ceb82f94e8e29a6d4c5c77dae37d21f63c3bef474da18e1255c25ad185d126d2a962cefcdc3de6989269a6be80cb1f477252d400a2cf3ba2151c9c18fda5c3
|
data/Manifest.txt
CHANGED
@@ -6,5 +6,9 @@ config/spritesheet_dia15-24x24.csv
|
|
6
6
|
config/spritesheet_dia15-24x24.png
|
7
7
|
config/spritesheet_dia16-24x24.csv
|
8
8
|
config/spritesheet_dia16-24x24.png
|
9
|
+
config/spritesheet_dia17-24x24.csv
|
10
|
+
config/spritesheet_dia17-24x24.png
|
11
|
+
config/spritesheet_dia20-24x24.csv
|
12
|
+
config/spritesheet_dia20-24x24.png
|
9
13
|
lib/smileys.rb
|
10
14
|
lib/smileys/version.rb
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
The Do-It-Yourself (DIY) [Factory of Modern Originals (FoMO)](https://github.com/
|
1
|
+
The Do-It-Yourself (DIY) [Factory of Modern Originals (FoMO)](https://github.com/profilepic/originals) Presents
|
2
2
|
|
3
3
|
|
4
4
|
# Smileys (Smilies)
|
@@ -9,22 +9,106 @@ Yes, you can! Generate your own 24×24 pixel smiley images (off-blockchain) with
|
|
9
9
|
|
10
10
|
|
11
11
|
|
12
|
-
* home :: [github.com/
|
13
|
-
* bugs :: [github.com/
|
12
|
+
* home :: [github.com/profilepic/text-to-image](https://github.com/profilepic/text-to-image)
|
13
|
+
* bugs :: [github.com/profilepic/text-to-image/issues](https://github.com/profilepic/text-to-image/issues)
|
14
14
|
* gem :: [rubygems.org/gems/smileys](https://rubygems.org/gems/smileys)
|
15
15
|
* rdoc :: [rubydoc.info/gems/smileys](http://rubydoc.info/gems/smileys)
|
16
16
|
|
17
17
|
|
18
18
|
|
19
19
|
|
20
|
+
|
20
21
|
## Usage
|
21
22
|
|
23
|
+
Note: The smileys in a 24x24 canvas come
|
24
|
+
in four diverent size variants - with
|
25
|
+
the smiley circle with a diameter of 15px, 16px, 17px and 20px.
|
26
|
+
|
27
|
+
|
28
|
+
|
22
29
|
Let's generate some super-rare never-before-seen
|
23
30
|
smileys / smilies:
|
24
31
|
|
25
|
-
|
32
|
+
```ruby
|
33
|
+
require 'smileys'
|
34
|
+
|
35
|
+
|
36
|
+
smiley = Smiley::Image.generate( "Yellow", "Face 1" )
|
37
|
+
smiley.save( "smiley1.png" )
|
38
|
+
smiley.zoom( 4 ).save( "smiley1@4x.png" )
|
39
|
+
|
40
|
+
base = smiley
|
41
|
+
|
42
|
+
smiley = base.background( 'ukraine' )
|
43
|
+
smiley.save( "smiley1.1.png" )
|
44
|
+
smiley.zoom( 4 ).save( "smiley1.1@4x.png" )
|
45
|
+
|
46
|
+
smiley = base.background( 'rainbow' )
|
47
|
+
smiley.save( "smiley1.2.png" )
|
48
|
+
smiley.zoom( 4 ).save( "smiley1.2@4x.png" )
|
49
|
+
|
50
|
+
|
51
|
+
# no - no outline variant
|
52
|
+
smiley = Smiley::Image.generate( "Yellow.No", "Face 1" )
|
53
|
+
smiley.save( "smiley1b.png" )
|
54
|
+
smiley.zoom( 4 ).save( "smiley1b@4x.png" )
|
55
|
+
|
56
|
+
# (re)try with eyes + mouth
|
57
|
+
smiley = Smiley::Image.generate( "Yellow", "Open", "Smile" )
|
58
|
+
smiley.save( "smiley1c.png" )
|
59
|
+
smiley.zoom( 4 ).save( "smiley1c@4x.png" )
|
60
|
+
```
|
61
|
+
|
62
|
+
Voila!
|
63
|
+
|
64
|
+
![](https://github.com/profilepic/text-to-image/raw/master/smileys/i/smiley1.png)
|
65
|
+
![](https://github.com/profilepic/text-to-image/raw/master/smileys/i/smiley1.1.png)
|
66
|
+
![](https://github.com/profilepic/text-to-image/raw/master/smileys/i/smiley1.2.png)
|
67
|
+
![](https://github.com/profilepic/text-to-image/raw/master/smileys/i/smiley1b.png)
|
68
|
+
![](https://github.com/profilepic/text-to-image/raw/master/smileys/i/smiley1c.png)
|
69
|
+
|
70
|
+
4x:
|
71
|
+
|
72
|
+
![](https://github.com/profilepic/text-to-image/raw/master/smileys/i/smiley1@4x.png)
|
73
|
+
![](https://github.com/profilepic/text-to-image/raw/master/smileys/i/smiley1.1@4x.png)
|
74
|
+
![](https://github.com/profilepic/text-to-image/raw/master/smileys/i/smiley1.2@4x.png)
|
75
|
+
![](https://github.com/profilepic/text-to-image/raw/master/smileys/i/smiley1b@4x.png)
|
76
|
+
![](https://github.com/profilepic/text-to-image/raw/master/smileys/i/smiley1c@4x.png)
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
```ruby
|
82
|
+
smiley = Smiley::Image.generate( "Greener", "Face 2" )
|
83
|
+
smiley.save( "smiley2.png" )
|
84
|
+
smiley.zoom( 4 ).save( "smiley2@4x.png" )
|
85
|
+
|
86
|
+
smiley = Smiley::Image.generate( "Greener.No", "Face 2" )
|
87
|
+
smiley.save( "smiley2b.png" )
|
88
|
+
smiley.zoom( 4 ).save( "smiley2b@4x.png" )
|
89
|
+
|
90
|
+
# (re)try with eyes + mouth
|
91
|
+
smiley = Smiley::Image.generate( "Greener", "Shades", "Grin (Right)" )
|
92
|
+
smiley.save( "smiley2c.png" )
|
93
|
+
smiley.zoom( 4 ).save( "smiley2c@4x.png" )
|
94
|
+
```
|
95
|
+
|
96
|
+
Voila!
|
97
|
+
|
98
|
+
![](https://github.com/profilepic/text-to-image/raw/master/smileys/i/smiley2.png)
|
99
|
+
![](https://github.com/profilepic/text-to-image/raw/master/smileys/i/smiley2b.png)
|
100
|
+
![](https://github.com/profilepic/text-to-image/raw/master/smileys/i/smiley2c.png)
|
101
|
+
|
102
|
+
4x:
|
103
|
+
|
104
|
+
![](https://github.com/profilepic/text-to-image/raw/master/smileys/i/smiley2@4x.png)
|
105
|
+
![](https://github.com/profilepic/text-to-image/raw/master/smileys/i/smiley2b@4x.png)
|
106
|
+
![](https://github.com/profilepic/text-to-image/raw/master/smileys/i/smiley2c@4x.png)
|
107
|
+
|
108
|
+
|
26
109
|
|
27
110
|
|
111
|
+
And so on.
|
28
112
|
|
29
113
|
|
30
114
|
|
data/Rakefile
CHANGED
@@ -16,7 +16,7 @@ Hoe.spec 'smileys' do
|
|
16
16
|
self.summary = "smileys - generate your own 24×24 pixel smiley images (off-blockchain) with text (via built-in spritesheets); incl. 2x/4x/8x zoom for bigger sizes and more"
|
17
17
|
self.description = summary
|
18
18
|
|
19
|
-
self.urls = { home: 'https://github.com/
|
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,9 +26,7 @@ Hoe.spec 'smileys' do
|
|
26
26
|
self.history_file = 'CHANGELOG.md'
|
27
27
|
|
28
28
|
self.extra_deps = [
|
29
|
-
['pixelart', '>= 1.3.2'],
|
30
29
|
['artfactory', '>= 0.2.0'],
|
31
|
-
['backgrounds', '>= 0.2.0'],
|
32
30
|
]
|
33
31
|
|
34
32
|
self.licenses = ['Public Domain']
|
@@ -0,0 +1,18 @@
|
|
1
|
+
id, category, name, more_names
|
2
|
+
0, , green.no,
|
3
|
+
1, , green,
|
4
|
+
2, , greener.no,
|
5
|
+
3, , greener,
|
6
|
+
4, , orange.no,
|
7
|
+
5, , orange,
|
8
|
+
6, , red.no,
|
9
|
+
7, , red,
|
10
|
+
8, , white.no,
|
11
|
+
9, , white,
|
12
|
+
10, , yellow.no,
|
13
|
+
11, , yellow,
|
14
|
+
12, , face1,
|
15
|
+
13, , face2,
|
16
|
+
14, , face3,
|
17
|
+
15, , face4,
|
18
|
+
16, , face5,
|
Binary file
|
@@ -0,0 +1,22 @@
|
|
1
|
+
id, category, name, more_names
|
2
|
+
0, , green.no,
|
3
|
+
1, , green,
|
4
|
+
2, , greener.no,
|
5
|
+
3, , greener,
|
6
|
+
4, , orange.no,
|
7
|
+
5, , orange,
|
8
|
+
6, , red.no,
|
9
|
+
7, , red,
|
10
|
+
8, , white.no,
|
11
|
+
9, , white,
|
12
|
+
10, , yellow.no,
|
13
|
+
11, , yellow,
|
14
|
+
12, , face1,
|
15
|
+
13, , face2,
|
16
|
+
14, , face3,
|
17
|
+
15, , face4,
|
18
|
+
16, , face5,
|
19
|
+
17, , face6,
|
20
|
+
18, , face7,
|
21
|
+
19, , face8,
|
22
|
+
20, , face9,
|
Binary file
|
data/lib/smileys/version.rb
CHANGED
data/lib/smileys.rb
CHANGED
@@ -1,15 +1,52 @@
|
|
1
1
|
## 3rd party
|
2
|
-
require 'backgrounds/base'
|
3
2
|
require 'artfactory/base'
|
4
3
|
|
5
4
|
|
6
5
|
|
7
6
|
## our own code
|
8
|
-
|
7
|
+
require_relative 'smileys/version' # note: let version always go first
|
9
8
|
|
10
9
|
|
10
|
+
module Smiley15 ## smiley circle with 15px diameter in 24x24 canvas
|
11
|
+
|
12
|
+
class Spritesheet
|
13
|
+
def self.builtin
|
14
|
+
@sheet ||= Pixelart::Spritesheet.read( "#{Pixelart::Module::Smileys.root}/config/spritesheet_dia15-24x24.png",
|
15
|
+
"#{Pixelart::Module::Smileys.root}/config/spritesheet_dia15-24x24.csv",
|
16
|
+
width: 24,
|
17
|
+
height: 24 )
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.find_by( name: ) ## return archetype/attribute image by name
|
21
|
+
builtin.find_by( name: name )
|
22
|
+
end
|
23
|
+
end # class Spritesheet
|
24
|
+
## add convenience (alternate spelling) alias - why? why not?
|
25
|
+
SpriteSheet = Spritesheet
|
26
|
+
Sheet = Spritesheet
|
27
|
+
Sprite = Spritesheet
|
28
|
+
|
29
|
+
|
30
|
+
class Image < Pixelart::Image
|
31
|
+
def self.generator
|
32
|
+
@generator ||= Artfactory.use( Smiley15::Sheet.builtin,
|
33
|
+
image_class: Image )
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
NAMES = ['smiley15', 'smileys15' ]
|
38
|
+
DEFAULT_ATTRIBUTES = ['Yellow', 'Face 1']
|
39
|
+
|
40
|
+
def self.generate( *names )
|
41
|
+
generator.generate( *names )
|
42
|
+
end
|
43
|
+
end # class Image
|
44
|
+
end
|
45
|
+
|
11
46
|
|
12
|
-
|
47
|
+
|
48
|
+
|
49
|
+
module Smiley16 ## smiley circle with 16px diameter in 24x24 canvas
|
13
50
|
|
14
51
|
class Spritesheet ## note: for now class used for "namespace" only
|
15
52
|
def self.builtin ### check: use a different name e.g. default,standard,base or such - why? why not?
|
@@ -36,7 +73,87 @@ module Smiley16
|
|
36
73
|
end
|
37
74
|
|
38
75
|
|
39
|
-
NAMES = ['smiley16', 'smileys16'
|
76
|
+
NAMES = ['smiley16', 'smileys16',
|
77
|
+
'smiley', 'smileys' ]
|
78
|
+
DEFAULT_ATTRIBUTES = ['Yellow', 'Face 1']
|
79
|
+
|
80
|
+
def self.generate( *names )
|
81
|
+
generator.generate( *names )
|
82
|
+
end
|
83
|
+
end # class Image
|
84
|
+
end
|
85
|
+
|
86
|
+
Smiley = Smiley16 ## note: make Smiley16 the DEFAULT Smiley (if no diameter specified)
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
module Smiley17 ## smiley circle with 17px diameter in 24x24 canvas
|
92
|
+
|
93
|
+
class Spritesheet ## note: for now class used for "namespace" only
|
94
|
+
def self.builtin ### check: use a different name e.g. default,standard,base or such - why? why not?
|
95
|
+
@sheet ||= Pixelart::Spritesheet.read( "#{Pixelart::Module::Smileys.root}/config/spritesheet_dia17-24x24.png",
|
96
|
+
"#{Pixelart::Module::Smileys.root}/config/spritesheet_dia17-24x24.csv",
|
97
|
+
width: 24,
|
98
|
+
height: 24 )
|
99
|
+
end
|
100
|
+
|
101
|
+
def self.find_by( name: ) ## return archetype/attribute image by name
|
102
|
+
builtin.find_by( name: name )
|
103
|
+
end
|
104
|
+
end # class Spritesheet
|
105
|
+
## add convenience (alternate spelling) alias - why? why not?
|
106
|
+
SpriteSheet = Spritesheet
|
107
|
+
Sheet = Spritesheet
|
108
|
+
Sprite = Spritesheet
|
109
|
+
|
110
|
+
|
111
|
+
class Image < Pixelart::Image
|
112
|
+
def self.generator
|
113
|
+
@generator ||= Artfactory.use( Smiley17::Sheet.builtin,
|
114
|
+
image_class: Image )
|
115
|
+
end
|
116
|
+
|
117
|
+
|
118
|
+
NAMES = ['smiley17', 'smileys17' ]
|
119
|
+
DEFAULT_ATTRIBUTES = ['Yellow', 'Face 1']
|
120
|
+
|
121
|
+
def self.generate( *names )
|
122
|
+
generator.generate( *names )
|
123
|
+
end
|
124
|
+
end # class Image
|
125
|
+
end
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
module Smiley20 ## smiley circle with 20px diameter in 24x24 canvas
|
130
|
+
|
131
|
+
class Spritesheet ## note: for now class used for "namespace" only
|
132
|
+
def self.builtin ### check: use a different name e.g. default,standard,base or such - why? why not?
|
133
|
+
@sheet ||= Pixelart::Spritesheet.read( "#{Pixelart::Module::Smileys.root}/config/spritesheet_dia20-24x24.png",
|
134
|
+
"#{Pixelart::Module::Smileys.root}/config/spritesheet_dia20-24x24.csv",
|
135
|
+
width: 24,
|
136
|
+
height: 24 )
|
137
|
+
end
|
138
|
+
|
139
|
+
def self.find_by( name: ) ## return archetype/attribute image by name
|
140
|
+
builtin.find_by( name: name )
|
141
|
+
end
|
142
|
+
end # class Spritesheet
|
143
|
+
## add convenience (alternate spelling) alias - why? why not?
|
144
|
+
SpriteSheet = Spritesheet
|
145
|
+
Sheet = Spritesheet
|
146
|
+
Sprite = Spritesheet
|
147
|
+
|
148
|
+
|
149
|
+
class Image < Pixelart::Image
|
150
|
+
def self.generator
|
151
|
+
@generator ||= Artfactory.use( Smiley20::Sheet.builtin,
|
152
|
+
image_class: Image )
|
153
|
+
end
|
154
|
+
|
155
|
+
|
156
|
+
NAMES = ['smiley20', 'smileys20' ]
|
40
157
|
DEFAULT_ATTRIBUTES = ['Yellow', 'Face 1']
|
41
158
|
|
42
159
|
def self.generate( *names )
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smileys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
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-10-
|
11
|
+
date: 2022-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: pixelart
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.3.2
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 1.3.2
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: artfactory
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,20 +24,6 @@ dependencies:
|
|
38
24
|
- - ">="
|
39
25
|
- !ruby/object:Gem::Version
|
40
26
|
version: 0.2.0
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: backgrounds
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 0.2.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.2.0
|
55
27
|
- !ruby/object:Gem::Dependency
|
56
28
|
name: rdoc
|
57
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -105,9 +77,13 @@ files:
|
|
105
77
|
- config/spritesheet_dia15-24x24.png
|
106
78
|
- config/spritesheet_dia16-24x24.csv
|
107
79
|
- config/spritesheet_dia16-24x24.png
|
80
|
+
- config/spritesheet_dia17-24x24.csv
|
81
|
+
- config/spritesheet_dia17-24x24.png
|
82
|
+
- config/spritesheet_dia20-24x24.csv
|
83
|
+
- config/spritesheet_dia20-24x24.png
|
108
84
|
- lib/smileys.rb
|
109
85
|
- lib/smileys/version.rb
|
110
|
-
homepage: https://github.com/
|
86
|
+
homepage: https://github.com/profilepic/text-to-image
|
111
87
|
licenses:
|
112
88
|
- Public Domain
|
113
89
|
metadata: {}
|