I make a selection with rubberBand on QLabel image.
I want to edit selection with posterize and threshold after I selected some area. For, example, at the end in mouseReleaseEvent() function;

Posterize - it's reduce number of colors (is available, for ex., in GIMP at "Colors -> Posterize..."). Threshold - is available in GIMP too at "Colors -> Threshold...".

So, can somebody help me in this task