retouch 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -4
- data/LICENSE +1 -1
- data/README.md +74 -67
- data/bench/retouch.rb +4 -2
- data/docs/index.html +28 -0
- data/lib/retouch/batch.rb +61 -41
- data/lib/retouch/cli.rb +178 -187
- data/lib/retouch/io.rb +5 -19
- data/lib/retouch/kernels/color.rb +18 -0
- data/lib/retouch/kernels/convolve.rb +60 -0
- data/lib/retouch/kernels/lut.rb +75 -0
- data/lib/retouch/operations/color.rb +21 -0
- data/lib/retouch/operations/draw.rb +160 -0
- data/lib/retouch/operations/filter.rb +64 -0
- data/lib/retouch/operations/multiple.rb +192 -0
- data/lib/retouch/operations.rb +31 -482
- data/lib/retouch/pipeline.rb +3 -4
- data/lib/retouch/version.rb +1 -1
- data/lib/retouch.rb +13 -5
- data/retouch.gemspec +2 -2
- data/sig/retouch.rbs +43 -11
- metadata +12 -4
data/sig/retouch.rbs
CHANGED
|
@@ -20,6 +20,33 @@ module Retouch
|
|
|
20
20
|
def self.offset: (Integer container_width, Integer container_height, Integer content_width, Integer content_height, Symbol | String gravity) -> [Integer, Integer]
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
module Operations
|
|
24
|
+
def self.info: (untyped image) -> Hash[Symbol, untyped]
|
|
25
|
+
def self.grayscale: (untyped image) -> untyped
|
|
26
|
+
def self.invert: (untyped image) -> untyped
|
|
27
|
+
def self.brightness: (untyped image, Numeric amount) -> untyped
|
|
28
|
+
def self.contrast: (untyped image, Numeric factor) -> untyped
|
|
29
|
+
def self.gamma: (untyped image, Numeric value) -> untyped
|
|
30
|
+
def self.saturate: (untyped image, Numeric factor) -> untyped
|
|
31
|
+
def self.tint: (untyped image, String color, ?amount: Numeric) -> untyped
|
|
32
|
+
def self.opacity: (untyped image, Numeric amount) -> untyped
|
|
33
|
+
def self.quantize: (untyped image, ?colors: Integer, ?dither: Symbol, ?palette: Array[Array[Integer]]?) -> untyped
|
|
34
|
+
def self.blur: (untyped image, Numeric sigma) -> untyped
|
|
35
|
+
def self.sharpen: (untyped image, Numeric sigma, ?amount: Numeric) -> untyped
|
|
36
|
+
def self.pixelate: (untyped image, Integer size) -> untyped
|
|
37
|
+
def self.overlay: (untyped image, untyped source, ?x: Integer?, ?y: Integer?, ?gravity: Symbol | String, ?opacity: Numeric, ?mode: Symbol) -> untyped
|
|
38
|
+
def self.watermark: (untyped image, untyped source, **untyped options) -> untyped
|
|
39
|
+
def self.text: (untyped image, String text, **untyped options) -> untyped
|
|
40
|
+
def self.rect: (untyped image, Integer x, Integer y, Integer width, Integer height, ?String color, ?fill: bool) -> untyped
|
|
41
|
+
def self.arrow: (untyped image, Integer x1, Integer y1, Integer x2, Integer y2, ?String color, ?width: Integer, ?head: Numeric) -> untyped
|
|
42
|
+
def self.append: (Array[untyped] images, ?direction: Symbol, ?gap: Integer, ?background: untyped) -> untyped
|
|
43
|
+
def self.montage: (Array[untyped] images, ?columns: Integer?, ?cols: Integer?, ?gap: Integer, ?background: untyped, ?labels: bool | Array[String]?) -> untyped
|
|
44
|
+
def self.spritesheet: (Array[untyped] images, ?max_width: Integer, ?gap: Integer, ?background: untyped) -> [untyped, Array[Hash[Symbol, Integer]]]
|
|
45
|
+
def self.diff: (untyped expected, untyped actual, ?threshold: Numeric, ?color: String) -> Hash[Symbol, untyped]
|
|
46
|
+
def self.animate: (Array[untyped] frames, String path, ?fps: Numeric?, ?delay: Numeric | Array[Numeric]?, ?loop: bool | Integer, ?colors: Integer, ?palette: Symbol | Array[Array[Integer]], ?dither: Symbol) -> String
|
|
47
|
+
def self.open_gif: (String path, ?frame: Symbol | Integer, ?max_pixels: Integer, ?max_frames: Integer, ?max_total_pixels: Integer) -> untyped
|
|
48
|
+
end
|
|
49
|
+
|
|
23
50
|
class Pipeline
|
|
24
51
|
def to_image: -> untyped
|
|
25
52
|
def info: -> Hash[Symbol, untyped]
|
|
@@ -30,28 +57,33 @@ module Retouch
|
|
|
30
57
|
def flip: -> Pipeline
|
|
31
58
|
def flop: -> Pipeline
|
|
32
59
|
def rotate: (Numeric degrees, **untyped options) -> Pipeline
|
|
60
|
+
def pad: (Integer amount, **untyped options) -> Pipeline
|
|
61
|
+
def extend: (Integer width, Integer height, **untyped options) -> Pipeline
|
|
33
62
|
def border: (Integer width, ?String color, **untyped options) -> Pipeline
|
|
63
|
+
def trim: (**untyped options) -> Pipeline
|
|
34
64
|
def grayscale: -> Pipeline
|
|
35
65
|
def invert: -> Pipeline
|
|
36
66
|
def brightness: (Numeric amount) -> Pipeline
|
|
37
|
-
def contrast: (Numeric
|
|
38
|
-
def gamma: (Numeric
|
|
39
|
-
def saturate: (Numeric
|
|
67
|
+
def contrast: (Numeric factor) -> Pipeline
|
|
68
|
+
def gamma: (Numeric value) -> Pipeline
|
|
69
|
+
def saturate: (Numeric factor) -> Pipeline
|
|
40
70
|
def tint: (String color, **untyped options) -> Pipeline
|
|
41
71
|
def opacity: (Numeric amount) -> Pipeline
|
|
42
|
-
def
|
|
43
|
-
def
|
|
72
|
+
def quantize: (**untyped options) -> Pipeline
|
|
73
|
+
def blur: (Numeric sigma) -> Pipeline
|
|
74
|
+
def sharpen: (Numeric sigma, **untyped options) -> Pipeline
|
|
44
75
|
def pixelate: (Integer size) -> Pipeline
|
|
45
|
-
def overlay: (String | untyped
|
|
46
|
-
def watermark: (String | untyped
|
|
76
|
+
def overlay: (String | untyped source, **untyped options) -> Pipeline
|
|
77
|
+
def watermark: (String | untyped source, **untyped options) -> Pipeline
|
|
47
78
|
def text: (String text, **untyped options) -> Pipeline
|
|
48
|
-
def rect: (String
|
|
49
|
-
def arrow: (
|
|
79
|
+
def rect: (Integer x, Integer y, Integer width, Integer height, ?String color, **untyped options) -> Pipeline
|
|
80
|
+
def arrow: (Integer x1, Integer y1, Integer x2, Integer y2, ?String color, **untyped options) -> Pipeline
|
|
50
81
|
end
|
|
51
82
|
|
|
52
|
-
def self.open: (String path
|
|
83
|
+
def self.open: (String path) -> Pipeline
|
|
53
84
|
def self.from_image: (untyped image) -> Pipeline
|
|
54
|
-
def self.
|
|
85
|
+
def self.open_gif: (String path, ?frame: Symbol | Integer, **untyped limits) -> (Array[untyped] | Pipeline)
|
|
86
|
+
def self.batch: (String | Array[String] inputs, to: String, ?jobs: Integer, ?force: bool) { (Pipeline) -> Pipeline } -> Array[String]
|
|
55
87
|
|
|
56
88
|
class CLI
|
|
57
89
|
def self.run: (Array[String] argv, ?out: untyped, ?err: untyped) -> Integer
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: retouch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yudai Takada
|
|
@@ -100,8 +100,8 @@ dependencies:
|
|
|
100
100
|
- - "~>"
|
|
101
101
|
- !ruby/object:Gem::Version
|
|
102
102
|
version: '3.6'
|
|
103
|
-
description: A pure Ruby image editor
|
|
104
|
-
|
|
103
|
+
description: A small pure Ruby image editor for color, filter, composite, annotation,
|
|
104
|
+
and batch operations on PNG, PPM, and BMP images.
|
|
105
105
|
email:
|
|
106
106
|
- t.yudai92@gmail.com
|
|
107
107
|
executables:
|
|
@@ -115,6 +115,7 @@ files:
|
|
|
115
115
|
- README.md
|
|
116
116
|
- Rakefile
|
|
117
117
|
- bench/retouch.rb
|
|
118
|
+
- docs/index.html
|
|
118
119
|
- exe/retouch
|
|
119
120
|
- lib/retouch.rb
|
|
120
121
|
- lib/retouch/batch.rb
|
|
@@ -122,7 +123,14 @@ files:
|
|
|
122
123
|
- lib/retouch/geometry.rb
|
|
123
124
|
- lib/retouch/gravity.rb
|
|
124
125
|
- lib/retouch/io.rb
|
|
126
|
+
- lib/retouch/kernels/color.rb
|
|
127
|
+
- lib/retouch/kernels/convolve.rb
|
|
128
|
+
- lib/retouch/kernels/lut.rb
|
|
125
129
|
- lib/retouch/operations.rb
|
|
130
|
+
- lib/retouch/operations/color.rb
|
|
131
|
+
- lib/retouch/operations/draw.rb
|
|
132
|
+
- lib/retouch/operations/filter.rb
|
|
133
|
+
- lib/retouch/operations/multiple.rb
|
|
126
134
|
- lib/retouch/pipeline.rb
|
|
127
135
|
- lib/retouch/version.rb
|
|
128
136
|
- retouch.gemspec
|
|
@@ -152,5 +160,5 @@ requirements: []
|
|
|
152
160
|
rubygems_version: 3.4.19
|
|
153
161
|
signing_key:
|
|
154
162
|
specification_version: 4
|
|
155
|
-
summary:
|
|
163
|
+
summary: Pure Ruby image editing and batch tools
|
|
156
164
|
test_files: []
|