IM7 Creating User Channels with Channel FX

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Alan Hadley
Posts: 48
Joined: 2010-03-31T12:17:55-07:00
Authentication code: 8675308

IM7 Creating User Channels with Channel FX

Post by Alan Hadley »

I would like to give the user of my program a chance to add user channels to an image by specifying the number they need. So I am building a Channel FX command string in C++ and I have discovered an oddity, am I doing something wrong, is this by design or is it a bug? My code looks like this:-

char s[256]="",s1[16];
strcpy_s(s,256,"r|g|b|a");
int i;
if(user_channels>24) user_channels=24;
for(i=0; i<user_channels; i++)
{
if(i==0) sprintf_s(s1,16,"|a=>%d",i+8);
else {
if(i<5) continue;
sprintf_s(s1,16,"|a=>%d",i+4);
}
strcat_s(s,s1);
}

This is more complex than it needs to be because adding one extra channel with "...|a=>8" always adds five. Adding one more using "...|a=>8|a>9" adds one more channel making six in all. This means I can not add 1, 2, 3 or 4 user channels, 5 is the minimum.

Also is there a simple way of creating thes user channels initialized to a constant "...|8=0" does not add a new channel.

Alan Hadley
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: IM7 Creating User Channels with Channel FX

Post by magick »

ImageMagick 6 series is limited to 5 channels. ImageMagick 7 series permits up to 32 channels. ImageMagick 7 is in beta right now and probably won't be released for several more years.
Alan Hadley
Posts: 48
Joined: 2010-03-31T12:17:55-07:00
Authentication code: 8675308

Re: IM7 Creating User Channels with Channel FX

Post by Alan Hadley »

Yes I noticed that the probable release date was getting further into the future, no problem. I have not released my prog for testing to anyone yet and when I eventually do I will emphasise that it and IM are not ready for final release, I hope to synchronize its official release with that of IM.

In the mean time is this still the best place to post comments about the Beta version of IM? I am using the Core interface.

Alan
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: IM7 Creating User Channels with Channel FX

Post by magick »

Posting about IMv7 here is fine. We'll need to investigate your issue further and get back to you.
Post Reply