# HG changeset patch # User Claus Gittinger # Date 1470658019 -7200 # Node ID 88b892a4012dce701271c0c01fb1517f71ee3c3d # Parent db4749aa5c603db6e408a756ca21fe3cfc9021e3 #FEATURE by cg class: ImageEditor changed: #colorMapMode: #findColorMapMode converting masked image to an alpha image diff -r db4749aa5c60 -r 88b892a4012d ImageEditor.st --- a/ImageEditor.st Wed Aug 03 14:32:31 2016 +0200 +++ b/ImageEditor.st Mon Aug 08 14:06:59 2016 +0200 @@ -1,3 +1,5 @@ +"{ Encoding: utf8 }" + " COPYRIGHT (c) 1997-1998 by eXept Software AG All Rights Reserved @@ -4014,7 +4016,10 @@ someOrAllUsedColors sort:self sortBlockForColors. newListOfColors addAll:someOrAllUsedColors. "/ listOfColors add:Color black; add:Color white. - ] + ]. + image mask notNil ifTrue:[ + newListOfColors := (Array with:(Color noColor)),newListOfColors. + ]. ] ifFalse:[ newListOfColors addAll:(image colorMap). ]. @@ -4024,6 +4029,9 @@ self colorMapMode: colorMapMode value. image := self image. ]. + "/ image mask notNil ifTrue:[ + "/ newListOfColors := (Array with:(Color noColor)),newListOfColors. + "/ ]. ]. newListOfColors notEmptyOrNil ifTrue:[ drawColor1 := newListOfColors at:1. @@ -5470,6 +5478,11 @@ ]. ] ifFalse:[ image mask: nil. + oldImage mask notNil ifTrue:[ + newImage depth == 32 ifTrue:[ + newImage computeAlphaValuesFromMask:oldImage mask + ]. + ]. ]. (newColorMap isOrderedCollection or:[newColorMap isFixedPalette not]) ifTrue:[