Magick Eraser / Pixel Deletion question
Posted: 2010-01-25T18:44:19-07:00
I just made up the weird topic name to give an idea of what i'm trying to do. The ImageMagick software is installed on my server and works fine. I have successfully used ImageMagick in scripts and it's really an amazing image tool, i've had many uses. However, There's one thing I was wondering about though. I have dug for hours all over the internet, and come close, but fail. I can't find a feature that does what i'm looking for.
I need to be able to remove all of one color, which is definitely possible with imagemagick (telling the whole "background color" to be transparent), however, what's wrong is that with what i'm doing, I need to apply alpha channels to an image, AND have the solid color background be transparent. I have somewhat succeeded, but then it doesn't work once I apply the alpha, or if I just apply the alpha the solid color stays around the avatar..
How would do this in an image application such as photoshop is to use magic want to select all of the background pixels, and then hit delete to literally destroy/remove the pixels, and then apply alpha channels.
The situation is, I am developing a script to allow people to use customized sprite sheet avatars in this interactive chat application. It supports alpha, but without alpha it just removes all pixels of the solid background color. If alpha exists it listens to the alpha and doesn't bother removing all of the one color. There's a cool thing you can do involving alpha to make "ghost avatars". So this is why I need this feature, so people don't need to have an advanced image application such as Paint Shop Pro or Photoshop just to do the effect.
Does anyone know of a way that all of one color can be deleted instead of made transparent? If I could delete all the pixels of a specific color (similar to if I define a color to be transparent), then adding alpha transparency is all that's left to do to make the script succeed.
I'd appreciate any advice you could give me.
* I thought I would mention in case it helps find a solution, when doing this in photoshop I have to duplicate the image then hide the other copy so that it isn't a part of the standard "background", with the other one disabled, I then select the solid color background of the image and then I can continue to delete it and add the alpha. i'm not sure if this sort of thing matters in imagemagick, but I thought I would give the additional info in case it helps find a way to do this.
I need to be able to remove all of one color, which is definitely possible with imagemagick (telling the whole "background color" to be transparent), however, what's wrong is that with what i'm doing, I need to apply alpha channels to an image, AND have the solid color background be transparent. I have somewhat succeeded, but then it doesn't work once I apply the alpha, or if I just apply the alpha the solid color stays around the avatar..
How would do this in an image application such as photoshop is to use magic want to select all of the background pixels, and then hit delete to literally destroy/remove the pixels, and then apply alpha channels.
The situation is, I am developing a script to allow people to use customized sprite sheet avatars in this interactive chat application. It supports alpha, but without alpha it just removes all pixels of the solid background color. If alpha exists it listens to the alpha and doesn't bother removing all of the one color. There's a cool thing you can do involving alpha to make "ghost avatars". So this is why I need this feature, so people don't need to have an advanced image application such as Paint Shop Pro or Photoshop just to do the effect.
Does anyone know of a way that all of one color can be deleted instead of made transparent? If I could delete all the pixels of a specific color (similar to if I define a color to be transparent), then adding alpha transparency is all that's left to do to make the script succeed.
I'd appreciate any advice you could give me.
* I thought I would mention in case it helps find a solution, when doing this in photoshop I have to duplicate the image then hide the other copy so that it isn't a part of the standard "background", with the other one disabled, I then select the solid color background of the image and then I can continue to delete it and add the alpha. i'm not sure if this sort of thing matters in imagemagick, but I thought I would give the additional info in case it helps find a way to do this.