Difference between canvas: and xc:

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
alansd

Difference between canvas: and xc:

Post by alansd »

Hi,

I only used ImageMagick for converting images to different formats before. I decided to learn more about IM, so the following is the first example I tried:

Code: Select all

convert -size 100x100 canvas:khaki  canvas_khaki.gif
This is from http://www.imagemagick.org/Usage/canvas/#solid.

It does not work! It gives the following error:

convert: no decode delegate for this image format `khaki' @ error/constitute.c/ReadImage/532.
convert: missing an image filename `canvas_khaki.gif' @ error/convert.c/ConvertImageCommand/2970.


However, it is fine if I replace canvas with xc:

Code: Select all

convert -size 100x100 xc:khaki  canvas_khaki.gif
I'm using Ubuntu 10.04, and my IM version is 6.6.2-5.

Can anyone explain the difference?

Thanks!

Alan
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Difference between canvas: and xc:

Post by fmw42 »

I believe that the newer canvas: is just an alias to xc: I am not sure why canvas: was introduced except that it is easier and more meaningful name for new users to recognize than xc: So the bottom line is no difference except for the name.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Difference between canvas: and xc:

Post by anthony »

I checked this with the previous discussion that generated the canvas: image generator.

Yes it is purely an alias for xc: which stood for "X window color", which came from the extreme early days of ImageMagick (long before my time). Of course color is usually a SVN color rather than X window color, so really the original name is rather useless. But that is what it is.

Canvas: is more meaning full (if more verbose), and I will make more use it in new examples, especially if the example uses things what was added after this change.

The documentation on image file formats (psuedo-formats) has already been updated to match this change.
Canvas gets listed first too, whcih is good considering its importance.
http://www.imagemagick.org/script/formats.php#pseudo
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: Difference between canvas: and xc:

Post by Drarakel »

Note that you need a newer ImageMagick version in order to use "canvas:". (I think it was included with v6.6.4-6.)
alansd wrote:I'm using Ubuntu 10.04, and my IM version is 6.6.2-5.
alansd

Re: Difference between canvas: and xc:

Post by alansd »

Drarakel wrote:Note that you need a newer ImageMagick version in order to use "canvas:". (I think it was included with v6.6.4-6.)
alansd wrote:I'm using Ubuntu 10.04, and my IM version is 6.6.2-5.
Oh.. I thought I had the latest version. Thanks (all of you)!

Alan
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Difference between canvas: and xc:

Post by anthony »

IM has a very active development group, suprising considering its current small size.

As such lastest is actually even 'newer' than the last point release!!

A lot of action has recently centered on improving the quality of distortion results.
WIth effects to image resize filters, and Variable Blur Mapping.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply