magick_filter 1.0.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +76 -3
- data/lib/filter.rb +2 -0
- data/lib/magick_filter.rb +19 -0
- data/lib/magick_filter/version.rb +2 -1
- data/test_image/deepskyblue.jpg +0 -0
- data/test_image/gold2.jpg +0 -0
- data/test_image/lightpink.jpg +0 -0
- data/test_image/orchid1.jpg +0 -0
- data/test_image/slateblue1.jpg +0 -0
- data/test_image/slategray4.jpg +0 -0
- data/test_image/snow.jpg +0 -0
- data/test_image/springgreen4.jpg +0 -0
- metadata +11 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80e30ff8460309cbd984d7d01a81d31fd70485c8c24b5612bc7db92e0dc3aa02
|
4
|
+
data.tar.gz: a024017c36637d4f41a13e3cbaa2d1bbb271e1ee07ccac34566702f6aa973a1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ed262d9be4d8b4ea334e7612540f79daa403f96a840047ec846070c408a3bb090df2c32067ad37da94c3e37639b71b638f32cf99f2654e5df94b1ac4cdae79c
|
7
|
+
data.tar.gz: ae7e2769ecefa921e712171ffa810acbcf11714f1536248a26e797b27a70265aed230437e5bf8d1ce932d0d7eb6d48697343bab47b1a05bb87cfcf056bd70c74
|
data/README.md
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
# MagickFilter
|
4
4
|
|
5
|
-
This Gem is an attempt to build Ruby Gem and release it to [rubygems.org](https://rubygems.org). If you want to convert your photo with some cool filters, you are at right place. This Gem is in early stage. I'll keep on adding some more filters and features with time.
|
5
|
+
This Gem is an attempt to build Ruby Gem and release it to [rubygems.org](https://rubygems.org). If you want to convert your photo with some cool filters or wants to add frame with different colors, you are at right place. Latest version of this gem allows you to add frame to existing photo. This Gem is in early stage. I'll keep on adding some more filters and features with time.
|
6
6
|
|
7
|
-
This Gem is based on [Image Magick](http://www.imagemagick.org/Usage/), So please make sure that you have image magick installed on your system.
|
8
7
|
|
8
|
+
This Gem is based on [Image Magick](http://www.imagemagick.org/Usage/), So please make sure that you have image magick installed on your system.
|
9
9
|
|
10
10
|
|
11
11
|
## Installation
|
@@ -25,9 +25,82 @@ Or install it yourself as:
|
|
25
25
|
$ gem install magick_filter
|
26
26
|
|
27
27
|
## Usage
|
28
|
+
1. Latest version of this Gem supports adding frame to photo with different colors. You can choose any desired color for frame from [ImageMagick color list](https://www.imagemagick.org/script/color.php)
|
29
|
+
|
30
|
+
2. In present there are 12 filters available in this Gem. Use the given below commands ( from Filter Examples section ) on console to convert photos.
|
31
|
+
|
32
|
+
## Frame Examples
|
33
|
+
|
34
|
+
### Original Image
|
35
|
+
|
36
|
+
<img src="/test_image/test.jpg" alt="Original" width=450 height=298 />
|
37
|
+
|
38
|
+
|
39
|
+
### Snow Color Frame
|
40
|
+
|
41
|
+
**`MagickFilter::Tool.apply_frame(image_path, "snow")`**
|
42
|
+
|
43
|
+
|
44
|
+
<img src="/test_image/snow.jpg" alt="snow" width=450 height=298 />
|
45
|
+
|
46
|
+
|
47
|
+
### LightPink Color Frame
|
48
|
+
|
49
|
+
**`MagickFilter::Tool.apply_frame(image_path, "LightPink")`**
|
50
|
+
|
51
|
+
|
52
|
+
<img src="/test_image/lightpink.jpg" alt="LightPink" width=450 height=298 />
|
53
|
+
|
54
|
+
|
55
|
+
### Orchid1 Color Frame
|
56
|
+
|
57
|
+
**`MagickFilter::Tool.apply_frame(image_path, "orchid1")`**
|
58
|
+
|
59
|
+
|
60
|
+
<img src="/test_image/orchid1.jpg" alt="orchid1" width=450 height=298 />
|
61
|
+
|
62
|
+
|
63
|
+
### SlateBlue1 Color Frame
|
64
|
+
|
65
|
+
**`MagickFilter::Tool.apply_frame(image_path, "SlateBlue1")`**
|
66
|
+
|
67
|
+
|
68
|
+
<img src="/test_image/slateblue1.jpg" alt="SlateBlue1" width=450 height=298 />
|
69
|
+
|
70
|
+
|
71
|
+
### SlateGray4 Color Frame
|
72
|
+
|
73
|
+
**`MagickFilter::Tool.apply_frame(image_path, "SlateGray4")`**
|
74
|
+
|
75
|
+
|
76
|
+
<img src="/test_image/slategray4.jpg" alt="SlateGray4" width=450 height=298 />
|
77
|
+
|
78
|
+
|
79
|
+
### DeepSkyBlue Color Frame
|
80
|
+
|
81
|
+
**`MagickFilter::Tool.apply_frame(image_path, "DeepSkyBlue")`**
|
82
|
+
|
83
|
+
|
84
|
+
<img src="/test_image/deepskyblue.jpg" alt="DeepSkyBlue" width=450 height=298 />
|
85
|
+
|
86
|
+
|
87
|
+
### SpringGreen4 Color Frame
|
88
|
+
|
89
|
+
**`MagickFilter::Tool.apply_frame(image_path, "SpringGreen4")`**
|
90
|
+
|
91
|
+
|
92
|
+
<img src="/test_image/springgreen4.jpg" alt="SpringGreen4" width=450 height=298 />
|
93
|
+
|
94
|
+
|
95
|
+
### Gold2 Color Frame
|
96
|
+
|
97
|
+
**`MagickFilter::Tool.apply_frame(image_path, "gold2")`**
|
98
|
+
|
99
|
+
|
100
|
+
<img src="/test_image/gold2.jpg" alt="gold2" width=450 height=298 />
|
28
101
|
|
29
|
-
In present there are five filters available in this Gem. Use the given below commands on console to convert photos.
|
30
102
|
|
103
|
+
## Filter Examples
|
31
104
|
|
32
105
|
### Original Image
|
33
106
|
|
data/lib/filter.rb
CHANGED
data/lib/magick_filter.rb
CHANGED
@@ -10,6 +10,13 @@ module MagickFilter
|
|
10
10
|
out_file = cmd_convert(path, out_file, effect)
|
11
11
|
end
|
12
12
|
|
13
|
+
def self.apply_frame(path='', color_type='')
|
14
|
+
parameter_missing?(path, color_type)
|
15
|
+
parse_if_image(path)
|
16
|
+
out_file = build_out_file_name(path)
|
17
|
+
out_file = cmd_convert_frame(path, out_file, color_type)
|
18
|
+
end
|
19
|
+
|
13
20
|
def self.root
|
14
21
|
File.expand_path('../..',__FILE__)
|
15
22
|
end
|
@@ -53,6 +60,14 @@ module MagickFilter
|
|
53
60
|
return out_file
|
54
61
|
end
|
55
62
|
|
63
|
+
def self.cmd_convert_frame(in_file=nil, out_file=nil, opts)
|
64
|
+
#in_file ||= current_source_file
|
65
|
+
#out_file ||= current_target_file
|
66
|
+
cmd(:convert, "#{in_file} #{get_frame_type(opts)} #{out_file}")
|
67
|
+
print "***Your file is available here to copy in desired location*** - #{out_file}"
|
68
|
+
return out_file
|
69
|
+
end
|
70
|
+
|
56
71
|
def self.build_out_file_name(path)
|
57
72
|
return "#{Filter::WRITE_PATH}/#{next_uuid}_output.#{get_file_extension(path)}"
|
58
73
|
end
|
@@ -68,5 +83,9 @@ module MagickFilter
|
|
68
83
|
def self.get_effect_options(effect)
|
69
84
|
Filter::EFFECT_MAP[effect.downcase.to_sym]
|
70
85
|
end
|
86
|
+
|
87
|
+
def self.get_frame_type(color_type)
|
88
|
+
Filter::FRAME_TYPE.gsub("Tomato", color_type)
|
89
|
+
end
|
71
90
|
end
|
72
91
|
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/test_image/snow.jpg
ADDED
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: magick_filter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- arvind02
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05
|
11
|
+
date: 2018-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -78,16 +78,24 @@ files:
|
|
78
78
|
- test_image/black&white.jpg
|
79
79
|
- test_image/bright.jpg
|
80
80
|
- test_image/contrast.jpg
|
81
|
+
- test_image/deepskyblue.jpg
|
81
82
|
- test_image/firebrick.jpg
|
82
83
|
- test_image/free-images.jpg
|
83
84
|
- test_image/gold.jpg
|
85
|
+
- test_image/gold2.jpg
|
86
|
+
- test_image/lightpink.jpg
|
84
87
|
- test_image/navy.jpg
|
88
|
+
- test_image/orchid1.jpg
|
85
89
|
- test_image/peach.jpg
|
86
90
|
- test_image/poster.jpg
|
87
91
|
- test_image/poster2.jpg
|
88
92
|
- test_image/rough.jpg
|
89
93
|
- test_image/sepiya.jpg
|
90
94
|
- test_image/sketch.jpg
|
95
|
+
- test_image/slateblue1.jpg
|
96
|
+
- test_image/slategray4.jpg
|
97
|
+
- test_image/snow.jpg
|
98
|
+
- test_image/springgreen4.jpg
|
91
99
|
- test_image/test.jpg
|
92
100
|
homepage: https://github.com/arvind02/magick_filter
|
93
101
|
licenses:
|
@@ -109,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
117
|
version: '0'
|
110
118
|
requirements: []
|
111
119
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.7.
|
120
|
+
rubygems_version: 2.7.7
|
113
121
|
signing_key:
|
114
122
|
specification_version: 4
|
115
123
|
summary: Photo Filters Gem
|