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

Reduce the number of colors on a selection

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.

5 of 5 messages available
Toggle history

Please log in to manage your subscriptions.

Reduce the number of colors on a selection Pere Pujal i Carabantes 02 Mar 19:49
  Reduce the number of colors on a selection vt 02 Mar 20:12
   Reduce the number of colors on a selection Pere Pujal i Carabantes 02 Mar 22:28
    Reduce the number of colors on a selection Chris Mohler 02 Mar 22:47
     Reduce the number of colors on a selection Pere Pujal i Carabantes 04 Mar 23:18
Pere Pujal i Carabantes
2008-03-02 19:49:48 UTC (over 16 years ago)

Reduce the number of colors on a selection

Hi all!

I want to reduce the number of colors like image->mode->indexed does, but just on the selected parts, not in the whole image.

Any hints?

Thanks Pere

vt
2008-03-02 20:12:28 UTC (over 16 years ago)

Reduce the number of colors on a selection

On Sunday 02 March 2008 20:49:48 Pere Pujal i Carabantes raš?:

Hi all!

I want to reduce the number of colors like image->mode->indexed does, but just on the selected parts, not in the whole image.

Any hints?

Thanks Pere

Right cllick on selection > Colors> Posterize

Pere Pujal i Carabantes
2008-03-02 22:28:09 UTC (over 16 years ago)

Reduce the number of colors on a selection

Hi vt, thanks for the reply.

El dg 02 de 03 del 2008 a les 21:12 +0200, en/na vt va escriure:

On Sunday 02 March 2008 20:49:48 Pere Pujal i Carabantes raš?:

I want to reduce the number of colors like image->mode->indexed does, but just on the selected parts, not in the whole image.

Right cllick on selection > Colors> Posterize

Acording to what I've find on the web(and on my tests), posterize doesn't take the colors from the image like image->mode->indexed does.

Anyway, I'm unable to find a suitable equivalence from number of colors on indexed to number of levels on posterize, some doc?

Thanks Pere

Chris Mohler
2008-03-02 22:47:59 UTC (over 16 years ago)

Reduce the number of colors on a selection

Maybe this:

1. Copy your selection 2. Edit->Paste as New
3. Image->Mode->Indexed
4. Image->Mode-RGB
5. Select All
6. Copy
7. Paste back into original image

I used to do something similar in Photoshop when I wanted to bitmap just a portion of an image.

HTH, Chris

Pere Pujal i Carabantes
2008-03-04 23:18:46 UTC (over 16 years ago)

Reduce the number of colors on a selection

Hi Chris, thanks for the reply.

El dg 02 de 03 del 2008 a les 15:47 -0600, en/na Chris Mohler va escriure:

Maybe this:

1. Copy your selection 2. Edit->Paste as New
3. Image->Mode->Indexed
4. Image->Mode-RGB
5. Select All
6. Copy
7. Paste back into original image

8 close the auxiliar image
9 confirm that I don't want to save...

To many steps, but it does just what I need, so here is a little script implementing that, it appears at colors->index-selection:

;; Copyright 2008 by Pere Pujal i Carabantes ;; License GNU/GPL
;; Author Pere Pujal i Carabantes

(define (script-fu-index-selection image
drawable
p-type
number-of-colors
palette
remove-unused
d-type
alpha-dither
)

(let*(
(dither-type (list-ref '(0 1 2 3) d-type)) (palette-type (list-ref '(0 2 3 4) p-type)) (indeximage)
)
(gimp-image-undo-group-start image) (gimp-edit-copy drawable)
(set! indeximage (car (gimp-edit-paste-as-new))) (gimp-image-convert-indexed indeximage dither-type palette-type number-of-colors alpha-dither remove-unused palette ) (gimp-image-convert-rgb indeximage) (gimp-selection-all indeximage)
(gimp-edit-copy (car (gimp-image-get-active-layer indeximage))) (gimp-floating-sel-anchor(car (gimp-edit-paste drawable 0))) (gimp-image-delete indeximage)
(gimp-displays-flush)
(gimp-image-undo-group-end image) ))

(script-fu-register
"script-fu-index-selection"
"/Colors/Index Selection"
"Reduces the colors on the current selection." "Pere Pujal i Carabantes"
"Copyright 2008"
""
""
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-OPTION "Palette Type" '("MAKE-PALETTE" "WEB-PALETTE" "MONO-PALETTE" "CUSTOM-PALETTE")
SF-ADJUSTMENT "Number of Colors (ignored unless Palette type=MAKE-PALETTE)" '(255 2 256 1 25 0 0) SF-PALETTE "Palette" "Web"
SF-TOGGLE "Remove unused (ignored if Palette type=MAKE-PALETTE)" FALSE SF-OPTION "Dither type" '("NO-DITHER" "Floid Steinberg" "Floid Steinberg LowBleed" "FIXED")
SF-TOGGLE "Alpha Dither" FALSE
)

Hope this helps other people too. Yours
Pere