Posted By: Corban Brook
Date: 2006-11-07 22:12
Summary: Rubyshop Alpha Release
Project: Rubyshop

Rubyshop 0.0.1 alpha gem has been released and source code has been setup on the SVN repository.

Rubyshop is designed to be make RMagick a lot easier to use. While composting images in RMagick i noticed it was difficult to do things like maskes and alpha transparencies without doing a lot of research and a bunch of code. I also didn't like how I had to composite images together before running transforms like rotations , movement, and scaling. Composting the images together or "flattening" the layers meant that I lost the layer mode (Multiply, Overlay, etc) in the flatten so layers underneath my flattened image didn't look how I wanted.

Rubyshop keeps the layers seperate until the last possible moment, saving the rendered image, allowing you to bundle your layers in layer sets and running transforms across the entire set without flattening. The final image is composited from the ground up, first with the blank canvas, then working its way up the stack applying the layer mode as it goes.

Rubyshop does not try to get in the way of RMagick, you can access your Magick::Image object through the layer and run RMagick specific methods on your image layers.

Documentation is lagging behind but will be ready for the 0.0.2 release, which should be pushing later this week.

For now please refer to the following demo code to get an idea of the syntax:

require 'rubyshop'
include Rubyshop

# This demonstrates creating a canvas and
# adding layer_sets and layers, adjusting
# layer_set and layer properties like, canvas
# offset, opacity, mode, rotation, scaling, etc

Canvas.new(320,240) do
layer_set :slides do
layer 'slide1.png' do
opacity 65
offset 12, 12
mode Lighten
image.crop_resized! 100,100
end
layer 'slide2.png' do
offset 28, 28
opacity 30
mode Darken
end

# these methods are layer_set transforms
# performed on all layers in the set

rotate 45
offset 12, 12
scale 64, 64
end

# layer without a set added to the canvas.
# It is added last and is the bottom of the
# layer stack.

layer 'background.png'

# You may reference layer_sets outside of their
# block as well.

layer_set :slides do
scale 200, 200
offset 10, 2
end

layer_set(:slides).rotate -15

# Saving renders out the layers to our final
# composited image.

save_as 'test.jpg'
end


*Rubyshop requires a working install of RMagick.

Thank you for your interest,

Corban Brook

Latest News
icalendar 1.4.0 Released
    Ryan Ahearn - 2013-05-21 23:17
BinData 1.5.0 - source moved to github
    Dion Mendel - 2013-05-21 11:10
v13.5.0 Released !!
    id 774 - 2013-05-18 12:28
Runt v0.9.0 Released
    Matthew Lipper - 2013-05-17 00:11
kramdown 1.0.2 released
    Thomas Leitner - 2013-05-09 06:58

 

Forums | Admin

Discussion Forums: rubyshop-alpha-release

Start New Thread Start New Thread

 

Topic Topic Starter Replies Last Post