class: ImageEditor
changed:
#colorMapMode:
fix conversion to lower depth images
#menu_compressColorMap
fix colormap compression
--- a/ImageEditor.st Tue Apr 08 18:30:47 2014 +0200
+++ b/ImageEditor.st Wed Apr 09 00:28:42 2014 +0200
@@ -4929,10 +4929,12 @@
^ self warn:(resources string:'Conversion failed !!')
] do:[
newImage := Image newForDepth:depth.
- newImage width:oldImage width height:oldImage height depth:depth.
- newImage colorMap:newColorMap.
- newImage photometric:#palette.
- newImage bits:(ByteArray new:(newImage bytesPerRow * newImage height)).
+ newImage
+ width:oldImage width height:oldImage height depth:depth;
+ colorMap:newColorMap;
+ photometric:#palette;
+ bits:(ByteArray new:(newImage bytesPerRow * newImage height));
+ mask:oldImage mask.
oldImage colorsFromX:0 y:0 toX:(oldImage width-1) y:(oldImage height-1) do:
[:x :y :clr |
@@ -4953,7 +4955,7 @@
image := newImage
].
] do:[
- image := newImage fromImage:oldImage.
+ image := newImage fromImage:oldImage photometric:newImage photometric.
].
(aMode asString startsWith:'mask') ifTrue:[
@@ -5365,7 +5367,7 @@
^ self
].
depth := oldImage depth.
- colorMap := oldImage colorMap asArray asSet.
+ colorMap := oldImage colorMap asArray.
usedColors := oldImage realUsedColors.
usedColors size == colorMap size ifTrue:[
self information:'Compress colorMap: Colormap already compressed - no compression.'.