stitchify 0.2.7 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stitchify.rb +1 -1
- data/lib/stitchify/pixelfy.rb +7 -16
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f228dfe33b05f3834ac9715b63ee94a9206bb8c
|
4
|
+
data.tar.gz: 0fff2007abda2ee1aeb2a2c0f2419de182caad78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8098552cb9b9ae86ae3e12aa9128ba3d38f813631bb908cbd2ea1683e4de13d57eebec3dd071340e42b97acd1e77c1d28bd990496ff3fdddb378ecaa2b82dad5
|
7
|
+
data.tar.gz: 2c9b22acaeca88525af07345fa776b886eade84e99a4abb343114e8540d87ef3dd8a54ea403a175a3dc3be76dee0d4e9169c0fee30fbcb6d8f3745fdeaf8a6c2
|
data/lib/stitchify.rb
CHANGED
data/lib/stitchify/pixelfy.rb
CHANGED
@@ -51,21 +51,12 @@ class Pixelfy
|
|
51
51
|
closest_px = map[0]
|
52
52
|
|
53
53
|
map.each do |dom_px|
|
54
|
-
|
55
|
-
|
56
|
-
if
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
elsif hue_delta == deltae
|
62
|
-
dom_px_delta = self.get_full_delta(dom_px)
|
63
|
-
current_px_delta = self.get_full_delta(closest_px)
|
64
|
-
if dom_px_delta < current_px_delta
|
65
|
-
deltae = hue_delta
|
66
|
-
closest_px = dom_px
|
67
|
-
end
|
68
|
-
end
|
54
|
+
dom_px_delta = self.get_delta_e(dom_px)
|
55
|
+
current_px_delta = self.get_delta_e(closest_px)
|
56
|
+
if dom_px_delta < current_px_delta
|
57
|
+
deltae = dom_px_delta
|
58
|
+
closest_px = dom_px
|
59
|
+
end
|
69
60
|
end
|
70
61
|
|
71
62
|
self.hue = closest_px.hue
|
@@ -76,7 +67,7 @@ class Pixelfy
|
|
76
67
|
self
|
77
68
|
end
|
78
69
|
|
79
|
-
def
|
70
|
+
def get_delta_e(px)
|
80
71
|
hue_delta = (px.hue - self.hue).abs
|
81
72
|
sat_delta = (px.saturation - self.saturation).abs
|
82
73
|
lit_delta = (px.lightness - self.lightness).abs
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stitchify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ellen Wondra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rasem
|
@@ -108,8 +108,8 @@ dependencies:
|
|
108
108
|
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 0.11.3
|
111
|
-
description:
|
112
|
-
|
111
|
+
description: takes a .jpg image and converts it to an SVG cross stitching pattern.
|
112
|
+
You can change the colors, the width, and the number of colors used.
|
113
113
|
email: ellenfromillinois@gmail.com
|
114
114
|
executables: []
|
115
115
|
extensions: []
|