Basic concepts Let's look at the RMagick equivalent of "Hello, world". This program reads an image file named "Cheetah.jpg" and displays1 it on your monitor 1. require 'RMagick' 2. include Magick 3. 4. cat = ImageList.new("Cheetah.jpg") 5. cat.display 6. exit MS Windows users note: The display method does not work on native MS Windows. You must use an external viewer to view the images you create.
► 2020 (9) ► 08/02 - 08/09 (1) ► 07/26 - 08/02 (4) ► 07/19 - 07/26 (4) ► 2019 (49) ► 06/09 - 06/16 (1) ► 06/02 - 06/09 (1) ► 05/26 - 06/02 (2) ► 05/19 - 05/26 (3) ► 03/17 - 03/24 (21) ► 03/10 - 03/17 (10) ► 02/03 - 02/10 (5) ► 01/27 - 02/03 (3) ► 01/13 - 01/20 (3) ► 2018 (72) ► 12/30 - 01/06 (3) ► 12/23 - 12/30 (6) ► 12/16 - 12/23 (5) ► 12/09 - 12/16 (3) ► 12/02 - 12/09 (7) ► 11/25 - 12/02 (8) ► 1
はじめに 前回はRMagickを用いて画像のリサイズの仕方を紹介しました。今回は、RMagickでのアニメGIFの取り扱いについて説明していきます。 なお、紹介するすべてのサンプルコードは、事前に以下のコードを実行している前提で記述しています。また、破壊メソッドと非破壊メソッドの両方があるメソッドについては、サンプルコードでは特段の理由がない限り破壊メソッドを利用しています。 require 'rubygems' require 'rmagick' height = 160 width = 160 scale = 0.5 サンプル画像は以下を用います。 図1 original.gif ※この画像は「ネムリクスリ」で配布されているものを使用させていただきました。 アニメGIFファイルの読み込み RMagickでアニメGIFファイルの読み込みを行う場合は、以下のようにImageList.new
This shop will be powered by Are you the store owner? Log in here
Revised 16Nov2007 This page describes a method for installing RMagick, ImageMagick, and the delegate libraries used by ImageMagick. I developed this procedure using a clean install of OS X 10.5 (Leopard) on a PowerPC PowerBook G4, but the procedure should be the same for Tiger and Intel Macs. You will need to have your OS X installation disk, a connection to the Internet, and at least an hour of f
RMagickの使い方のメモ ライブラリのロード require 'RMagick' ファイルの読み込み img = Magick::ImageList.new(path) 画像のサイズ img.columns #=> 横幅 img.rows #=> 高さ 画像のサイズを変更する width = 100 #横幅 height = 80 #高さ image.resize(width, height) 縦横比を固定して画像のサイズを変更する width = 100 height = (img.rows.to_f * width.to_f / img.columns.to_f).to_i img.resize(width, height) 画像を保存する img.write('/path/to/file') 画像を回転する amount = 90 #角度(時計回り) new_img = img.
Thumbnails are just the start! Check out the RMagick portfolio. The first page shows some basic transformations. Page 2 demonstrates special effects. Page 3 illustrates the drawing API. There are two versions of RMagick, RMagick 1 and RMagick 2. Most people will want to install RMagick 2. This version works with Ruby 1.8.2 and later (including Ruby 1.9) and ImageMagick 6.3.0 and later. All new enh
Posted by Corban Brook Wed, 18 Oct 2006 19:46:32 GMT edit Yesterday I was glancing Douglas Bowman’s Photo gallery and a fun idea came to me. Inspired by using photo slides on a light table, Douglas employs a unified theme and feel across his gallery. Kindly he released the theme free for use and is available for download on his website. Douglas is an incredible graphic artist and prepares lovel
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く