Is there a Ruby library out there for Win32 that will do simple image
manipulations? Specifically I want to resize (with high quality resampling)
and rotate JPG or PNG files.
If not… would it be possible to make calls to GDI+ using Win32API?
On Thursday, September 25, 2003, at 12:40 AM, Joe Cheng wrote:
Hi Rubyists,
Is there a Ruby library out there for Win32 that will do simple image
manipulations? Specifically I want to resize (with high quality
resampling)
and rotate JPG or PNG files.
You can get full access to the .net framework System.Drawing namespace (and
thus at least part of GDI+) through one of the rubydotnet bridges.
Don’t know if System.Drawing.Image provides the high quality operations
you’re looking for though.
s,
Rodrigo
···
----- Original Message -----
From: “Joe Cheng” code@joecheng.com
Newsgroups: comp.lang.ruby
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Thursday, September 25, 2003 1:40 AM
Subject: Win32 graphics library
Hi Rubyists,
Is there a Ruby library out there for Win32 that will do simple image
manipulations? Specifically I want to resize (with high quality
resampling)
and rotate JPG or PNG files.
If not… would it be possible to make calls to GDI+ using Win32API?
Well, it’s not win32, but ImageMagick + rmagick will, reportedly, work
with cygwin. rmagick is available here:
Thanks Mark. I’ll use those if I have to, but I’m hoping to find something
more lightweight; I’d rather my users not have to download and install
Cygwin, ImageMagick and Ruby.
You can get full access to the .net framework System.Drawing namespace
(and
thus at least part of GDI+) through one of the rubydotnet bridges.
Don’t know if System.Drawing.Image provides the high quality operations
you’re looking for though.
Thanks for the suggestion. Yes, System.Drawing would be more than adequate.
GDI+'s resampling algorithms are very high-quality, as far as these eyes can
tell (I used them for my wedding photos website). And I guess there is a
higher chance of people having the .NET framework already installed than
cygwin/*Magick. Still, for those that don’t, a 25MB download is pretty
painful…
I’m going to look into writing a simple Ruby extension in C that wraps the
GDI calls I need. It’d be really nice to just have this tiny DLL that ships
alongside an exerb-ed Ruby program…
You might also check out Ruby/DL. It allows you to call external DLL
functions using pure Ruby, and if your application is simple enough it might
be easier than writing a C extension.
I’m going to look into writing a simple Ruby extension in C
that wraps the GDI calls I need. It’d be really nice to just
have this tiny DLL that ships alongside an exerb-ed Ruby program…
Thanks for the suggestion. Yes, System.Drawing would be more than adequate.
GDI+'s resampling algorithms are very high-quality, as far as these eyes can
tell (I used them for my wedding photos website). And I guess there is a
higher chance of people having the .NET framework already installed than
cygwin/*Magick. Still, for those that don’t, a 25MB download is pretty
painful…
The quality options may be there, but it is very slow. Much of GDI+ is
not hardware accelerated… apparently to be rectified come Longhorn…
В сообщении от 25 Сентябрь 2003 19:01 Joe Cheng написал(a):
Well, it’s not win32, but ImageMagick + rmagick will, reportedly, work
with cygwin. rmagick is available here:
Thanks Mark. I’ll use those if I have to, but I’m hoping to find something
more lightweight; I’d rather my users not have to download and install
Cygwin, ImageMagick and Ruby.
Won’t GD do? It needs some other libs like libz, libpng and libjpeg but those
are portable as well…