Jump to content

Color quantization: Difference between revisions

m
bugfix/force RGB no alpha
m (bugfix/force RGB no alpha)
Line 1,540:
imImage im1 = imFileImageLoadBitmap("Quantum_frog.png",0,pError)
if im1=NULL then ?"error opening Quantum_frog.png" abort(0) end if
-- stolen from simple_paint (else im_pixel crashed):
-- we are going to support only RGB images with no alpha
imImageRemoveAlpha(im1)
if im_color_space(im1)!=IM_RGB then
imImage new_image = imImageCreateBased(im1, -1, -1, IM_RGB, -1)
imConvertColorSpace(im1, new_image)
imImageDestroy(im1)
im1 = new_image
end if
 
Ihandln image1 = IupImageFromImImage(im1),
image2 = colorQuant(im1,16),
7,813

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.