Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

compass-magick

> 编程语言
Open source

Dynamic image generation for Compass using ChunkyPNG/PhantomJS.

157 stars0 likes0 views
WebsiteGitHub

About

Dynamic image generation for Compass using ChunkyPNG/PhantomJS.

Compass Magick

Dynamic image generation for Compass using ChunkyPNG/PhantomJS (no dependency on RMagick).

Example

body {
  background: transparent magick-canvas(100px, 100px,
    magick-fill(magick-linear-gradient(red, green, blue))
  ) repeat-x;
}

A CSS3 Sassy Button recreated in Compass Magick:
StanAngeloff.github.com/compass-magick/ (showcases all features)

Installation

Installation is simple via RubyGems. Compass and ChunkyPNG are required.

gem install compass-magick

If you wish to use PhantomJS, please follow the build instructions.

Usage

To start a new Compass project with Magick included:

compass create -r magick my_project

To use Compass Magick within your existing projects, require the plugin from your Compass configuration:

require 'magick'

There is a short tutorial available which should guide you through creating a simple themeable button.

APIs

List of all available commands.

RDoc is also available for the entire project.

Similar Projects

compass-canvas is a Compass plugin that provides a drawing surface similar to the `` element in JavaScript and Turtle graphics in other programming languages. It uses Cairo as a back-end to perform all graphics operations. The project supports anti-aliasing, vector graphics, gradients, masks, clipping, complex operations like drop shadow and many more.

Contribute

Compass Magick is very much a work in progress. Documentation is sparse, speed is a major issue and there are probably a lot of bugs.

You can help by looking at any of the following areas (ordered by priority):

  • Optimizing the code as floating point math may not always be needed and too many object copies sucks
  • Writing tests to make sure nothing breaks in new versions
  • Performing code reviews since this is my very first Ruby project and I don't have any experience with the language so there are probably many stOOpid things in code
  • Improving RDoc because you can never have too much documentation
  • Adding new plugins. Compass Magick looks for Ruby files and imports those on startup
  • Submitting more examples to show off what Compass Magick can do
  • Opening issues for features you find missing or broken
  • Porting over some of CamanJS' goodness, we all love visual effects

Credits

  • Willem van Bergen for his great work on ChunkyPNG which has been a major source of knowledge while working on the project
  • Chris Eppstein for Compass itself
  • The Ruby community for being awesome and welcoming a stranger

Copyright

Copyright (c) 2011 Stan Angeloff. See LICENSE.md for details.

Issues· 5 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ruby

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言