Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kjunichi/mruby-mrmagick
being like rmagick :) in mruby
https://github.com/kjunichi/mruby-mrmagick
imagemagick mrbgems mruby
Last synced: 24 days ago
JSON representation
being like rmagick :) in mruby
- Host: GitHub
- URL: https://github.com/kjunichi/mruby-mrmagick
- Owner: kjunichi
- License: other
- Created: 2015-04-23T05:43:21.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-02T23:08:04.000Z (over 6 years ago)
- Last Synced: 2024-04-14T05:47:20.588Z (7 months ago)
- Topics: imagemagick, mrbgems, mruby
- Language: Ruby
- Homepage:
- Size: 140 KB
- Stars: 13
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mruby-mrmagick [![Build Status](https://travis-ci.org/kjunichi/mruby-mrmagick.png?branch=master)](https://travis-ci.org/kjunichi/mruby-mrmagick) [![Build status](https://ci.appveyor.com/api/projects/status/8ay7ic4abok7bjg2/branch/master?svg=true)](https://ci.appveyor.com/project/kjunichi/mruby-mrmagick/branch/master)
ImageMagick binding for mruby.
I don't know or use the whole ImageMagick library.
I have deliberately let some modules out of these bindings in order to focus on parts I understand and/or have a need for.## install by mrbgems
- add conf.gem line to `build_config.rb`
```ruby
MRuby::Build.new do |conf|# ... (snip) ...
conf.gem :mgem => 'mruby-mrmagick'
end
```## example
```ruby
img = Mrmagick::ImageList.new("sample.png") # read image file.
new_img = img.blur_image(0.0, 8.0) # returns new image which bluerd.
new_img.write("blur.jpg")
``````ruby
img = Mrmagick::ImageList.new("sample.jpg") # read image file.
new_img = img.scale(0.5) # returns new image which scaled.
new_img.write("half.png")
``````ruby
img = Mrmagick::ImageList.new("sample.png") # read image file.
img2 = img.blur_image(0.0, 8.0) # returns new image which bluerd.
img3 = img2.scale(4) # returns new image which scaled.
img3.write("blur_x4.jpg")
``````ruby
img = Mrmagick::ImageList.new("sample.jpg") # read image file.
img.get_exif_by_entry('GPSLatitude')```
```ruby
img = Mrmagick::ImageList.new("sample.jpg") # read image file.
img2 = img.blur_image(0.0, 8.0) # returns new image which bluerd.
File.open("blob.jpg", "wb") {|f|
f.print img2.to_blob
}
``````ruby
img = Mrmagick::ImageList.new("sample_with_exif.jpg")
img.orientation # => 2
img = img.auto_orient
img.write("sample_ao.jpg")
img = Mrmagick::ImageList.new("sample_ao.jpg")
img.orientation # => 1
```## See also
- [How to build one binary using with mruby cli](https://github.com/kjunichi/mruby-mrmagick/wiki/How-to-build-one-binary-using-with-mruby-cli)
- [How to build h2o with mruby-mrmagick](https://github.com/kjunichi/mruby-mrmagick/wiki/How-to-build-h2o-with-mruby-mrmagick)
- [Rubyist Magazine - RedDotRubyConf 2015 レポート](http://magazine.rubyist.net/?0051-RedDotRubyConf2015#l7)
- [ngx_mrubyを使った簡単な画像変換サーバを数分で実装してみた - 人間とウェブの未来](http://hb.matsumoto-r.jp/entry/2015/05/13/234326)## License
under the MIT License:
- see LICENSE file