RSS/Atom feed Twitter
Site is read-only, email is disabled

swapping color - resolved

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

6 of 6 messages available
Toggle history

Please log in to manage your subscriptions.

swapping color Bob Meetin 29 Apr 17:12
  swapping color Chris Mohler 29 Apr 17:48
   swapping color Scott Bicknell 29 Apr 18:42
    swapping color Scott Bicknell 29 Apr 18:52
     swapping color - resolved Bob Meetin 30 Apr 22:53
  swapping color Owen 29 Apr 23:38
Bob Meetin
2007-04-29 17:12:18 UTC (over 17 years ago)

swapping color

I inherited an image, a logo, in which I need to swap out one color, solid region, for another. Seems simple.

I open in gimp, select the region using, have tried both 'Select regions by color' and 'Select contiguous regions', then apply any new color and I end up with a mix of the original and replacement color. After befuddling myself for an hour (including using other image editing software) I copied the image from .gif to both .jpg and .png format. As a .png or .jpg the color replacement works fine.

See the 3 'raw' images at

www.dottedi.biz/codesamples/images/shape.gif www.dottedi.biz/codesamples/images/shape.jpg www.dottedi.biz/codesamples/images/shape.png

I don't really want to be using .jpg or .png images unless I have to. So the question, what is causing the replacement to fail and is there a way to make or convet the .gif accept the color swap?

-Bob

Chris Mohler
2007-04-29 17:48:33 UTC (over 17 years ago)

swapping color

On 4/29/07, Bob Meetin wrote:

I inherited an image, a logo, in which I need to swap out one color, solid region, for another. Seems simple.

[...]

I don't really want to be using .jpg or .png images unless I have to. So the question, what is causing the replacement to fail and is there a way to make or convet the .gif accept the color swap?

GIF is in 'indexed color' - that's why your color operations don't do what you expect. Convert to RGB, perform operation(s), then re-save as GIF (returning the image to indexed).

Personally I'd use PNG, as GIF has almost outlived its usefulness.

Chris

Scott Bicknell
2007-04-29 18:42:29 UTC (over 17 years ago)

swapping color

On Sunday, April 29, 2007 8:48 am, Chris Mohler wrote:

Personally I'd use PNG, as GIF has almost outlived its usefulness.

Chris has a point, especially when your gifs don't use transparency. If you save your png as an indexed, rather than rgb, color image, or grayscale, if that is appropriate, you will achieve smaller file sizes than gif can. And if you run a png optimizer afterward, you will get better results, still.

I created a test image 400x300 pixels and filled it with a gradient from upper left to lower right (white to black). Then saved it as a gif. It was 58.5 KB. After re-saving it as a grayscale png and optimizing it using optipng, it was 18.5 KB.

Scott Bicknell
2007-04-29 18:52:06 UTC (over 17 years ago)

swapping color

On Sunday, April 29, 2007 9:42 am, Scott Bicknell wrote:

I created a test image 400x300 pixels and filled it with a gradient from upper left to lower right (white to black). Then saved it as a gif. It was 58.5 KB. After re-saving it as a grayscale png and optimizing it using optipng, it was 18.5 KB.

Doing the same with your example images resulted in a png that was 379 bytes, where your gif is 482 bytes and your jpg is 1,309 bytes.

Owen
2007-04-29 23:38:50 UTC (over 17 years ago)

swapping color

On Sun, 29 Apr 2007 09:12:18 -0600 Bob Meetin wrote:

I inherited an image, a logo, in which I need to swap out one color, solid region, for another. Seems simple.

I open in gimp, select the region using, have tried both 'Select regions by color' and 'Select contiguous regions', then apply any new color and I end up with a mix of the original and replacement color. After befuddling myself for an hour (including using other image editing software) I copied the image from .gif to both .jpg and .png format. As a .png or .jpg the color replacement works fine.

See the 3 'raw' images at

www.dottedi.biz/codesamples/images/shape.gif www.dottedi.biz/codesamples/images/shape.jpg www.dottedi.biz/codesamples/images/shape.png

I don't really want to be using .jpg or .png images unless I have to. So the question, what is causing the replacement to fail and is there a way to make or convet the .gif accept the color swap?

Open your image
Save it as an xcf file
Image->Mode->RGB
Filters->Filters->Colours->Colour to Alpha

Then create a new layer and do your filling as required

Owen

Bob Meetin
2007-04-30 22:53:19 UTC (over 17 years ago)

swapping color - resolved

Yes - Converting to RGB and resaving as .gifsolved the problem. Thanks to all. And yes, too - I understand the effects of the various common image types. In this case I need to stick with .gif unless the client says different (and I will offer some explanation). Too bad IE (6) does not offer better support for transparency with .pngs. The pngfix workarounds are fatiguing.

happy to go, Bob

Scott Bicknell wrote:

On Sunday, April 29, 2007 9:42 am, Scott Bicknell wrote:

I created a test image 400x300 pixels and filled it with a gradient from upper left to lower right (white to black). Then saved it as a gif. It was 58.5 KB. After re-saving it as a grayscale png and optimizing it using optipng, it was 18.5 KB.

Doing the same with your example images resulted in a png that was 379 bytes, where your gif is 482 bytes and your jpg is 1,309 bytes.