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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 951224b51f5c1c5fdbc210c446bfda63de83281fad3bf3d3b72d28efd6d80919
4
- data.tar.gz: a6223fc4965436908dc014c34f9e89b6ba13a947e7adf67afa9e18952b303034
3
+ metadata.gz: 80e30ff8460309cbd984d7d01a81d31fd70485c8c24b5612bc7db92e0dc3aa02
4
+ data.tar.gz: a024017c36637d4f41a13e3cbaa2d1bbb271e1ee07ccac34566702f6aa973a1a
5
5
  SHA512:
6
- metadata.gz: 99b638d927b61b1272034e6b7ab3441999771f1e8c2c5a20b9120a17eca4c1ce5a5e23f2547ab21a44e239c84f42588ca1b8eaaf13c3b5ec9d971fc333b63fe6
7
- data.tar.gz: 8842a9d42565315d546ee8159825fc70029777eb22fba8feca52c6f60a09737eabbca85ba5c937e2b7730b4e14f136590bf11ba1a6fec133314455831aa0b5c0
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
 
@@ -12,6 +12,8 @@ module Filter
12
12
  rough: "-dither FloydSteinberg -colors 8",
13
13
  sepia: "-sepia-tone 80%"}
14
14
 
15
+ FRAME_TYPE = "-mattecolor Tomato -frame 20x20+10+10"
16
+
15
17
  WRITE_PATH = "/tmp"
16
18
  end
17
19
 
@@ -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
@@ -1,3 +1,4 @@
1
1
  module MagickFilter
2
- VERSION = "1.0.2"
2
+ VERSION = "2.0.0"
3
3
  end
4
+
Binary file
Binary file
Binary file
Binary file
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: 1.0.2
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-23 00:00:00.000000000 Z
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.6
120
+ rubygems_version: 2.7.7
113
121
  signing_key:
114
122
  specification_version: 4
115
123
  summary: Photo Filters Gem