Ruby Equivalent of the GD Library usage in PHP - ruby

I am looking to write an app that overlays images and copy on top of another image. I know in PHP you can use the GD library but for Ruby does anyone have a specific suggestion of a gem that would help with this?
I have seen 2 gems already but not sure which is the one most people use.
https://github.com/Spakman/ruby-gd
http://rubygems.org/gems/gd2

gd is a bit dated as a library for image manipulation/processing. The gems you listed are old, quite old in fact and likely will have issues with newer versions of Ruby.
Based on my own experience, I would look into a gem like minimagick which provides a nice interface to ImageMagick which is a more common library for the tasks you're trying to do.

The modern version of gem for working with GD library is https://github.com/dark-panda/gd2-ffij ... obviously, ImageMagick bindings are more powerful, but ImageMagick library have much more dependences and is generally heavyweight.

Related

Packaging ruby gtk app

What is the least headache technique to package a gtk2/gtk3 app built with ruby for distribution as an executable, for windows, linux, macos?
I could not find any guides or helpers to resolve this for ruby gtk. Nor the ruby-gnome gem comes with a packager.
It is my understanding that gtk is cross-platform, so it should not be trivial to do this. Problem is I am unable to find anythin reliable to follow as an example and learn the steps.
I've come across the same problem as you and I've put the question directly to the GTK3 developers.
here is their answer.
Which means that if you choose to use GTK3 today with Ruby, you have to:
Deliver MSYS2 and Ruby with your GEM.
Deliver your gem and tell users to install themselves msys2 (with updates) and ruby and your gem with dependencies.
It seems that the core developers of ruby-gnome2 are unconcerned about app distribution outside the Ruby community.
For example, Mr. Sutou, one of the maintainers of ruby-gnome2, distributes his Ruby/Gtk presentation tool "Rabbit" only as a Ruby Gem.

How can I create debian package (*.deb) from ruby application written with qt4?

I found a lot of tutorials how to build application with Ruby and Qt, but i have no idea how anybody else will be able to run it! I am using Ubuntu 11.10, ruby 1.9.2 with rvm and:
rbqtapi -v output "QtRuby 2.0.5 using Qt-4.7.4"
P.S. I have no idea how to build *.deb, it will be my first desktop app, not web.
please have a look on http://shoesrb.com/ this is the best way I heard off for writing GUI apps.
Shoes has now not it's greatest time, but we put our best time to make it better, give it a try and someone will help you.
In case you are in need of assistance just ask as question on #shoes IRC channel on freenode servers.
If you're sold on QT, then you will need your users to install all the support libraries for QT (and anything else), then you can upload a rubygem to rubygems.org for your users to download.
Once, they've installed the support libraries, you'd only need to update your rubygem, which is fairly quick and easy for updates.
You may also wan to look at visualruby. It uses GTK. Then you'd install the GTK libraries instead of the QT ones.
http://www.visualruby.net
As far as .deb packages go, I tried to research the same thing with little success. The rubygems packaging system is designed to distribute ruby programs, so it is the best way to go. Also, you'll need to install different support libraries for different platforms. If you look at visualruby's install page, you can see how to install GTK for Linux and Windows.
Good Luck.

Ruby wrapper for libjpeg to resize image

is there a ruby wrapper for the libjpeg library (http://www.ijg.org/)? What I'm trying to do is create an extension to the Rhomobile Framework so that I can resize images on my mobile app.
Thanks,
Nick,
The easiest solution might be to offload this work to an external service if possible.
I did find this though: jpegtran ruby gem jpegtran can be used to resize via libjpeg, if available on the platform.
not sure if it will suit your needs for mobile, but give rmagick a spin

Alternatives for HornetsEye - Ruby

I installed HornetsEye, that "real-time computer vision library" for some experiments with my webcam. I want to know if are there other alternatives in ruby?
RMagick comes to mind, but it is not very very performant ...
I have not tested it yet personally, but since OpenCV is definitely the way to go from C++, the ruby-opencv gem could be interesting. I could only find this one actively developped, though.
http://github.com/ruby-opencv/ruby-opencv
Perhaps Camellia Image Processing Library interests you because.
It has been written in C but has a native wrapper for RUBY and its performance is very good.

Ruby 1.9 compatible plotting / graphic library?

I feel like I have a simple desire that no one can satisfy: I want to be able to graph a set of points, and I am using Ruby 1.9.2.
I would like to use Gruff or Scruffy, since these seem to be the easiest to use. However, they both rely on rmagick, and it seems that many other libraries do to. Rmagick isn't compatible with Ruby 1.9 though. (not to mention, I've read that you should just stay away from it anyways...I would enjoy hearing reasons)
I am using wxRuby for a project, but in the future I will be needing simple graphs in other places, such as online and just command line scripts. Therefore, if someone has a solution for wxRuby, that is great, but an all-encompassing solution would be even better.
Thank you!
P.S.
I've seen gnuplot, but it would be a bit overkill. If that's my best option, I can live with that. I've also seen RGL, but I didn't look too long at it.
EDIT: Just to add, neither Gruff or Scruffy have been updated since August 2009, and I would like to find something that is at least semi-maintained. SVG::Graph looks very powerful, but hasn't been updated since Sept. '09. There is a fork of it on rubygems though which says it is 1.9 compatible, maybe I will try that if I can't get Scruffy or Gruff to play nice.
There may be some wx lib you could use.
Barring that I use rmagick with 1.9 (what's your platform?)
and it appears there have been some updates to those gems, though not new releases in awhile.
http://ruby-toolbox.com/categories/graphing.html

Resources