equal
deleted
inserted
replaced
4700 |
4700 |
4701 "/ translation table |
4701 "/ translation table |
4702 oldToNew := ByteArray new:(1 bitShift:depth). |
4702 oldToNew := ByteArray new:(1 bitShift:depth). |
4703 newColorMap := usedColors asArray. |
4703 newColorMap := usedColors asArray. |
4704 newColorMap sort:self sortBlockForColors. |
4704 newColorMap sort:self sortBlockForColors. |
4705 |
4705 oldImage colorMap notNil ifTrue:[ |
4706 oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr | |
4706 oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr | |
4707 |newPixel| |
4707 |newPixel| |
4708 |
4708 |
4709 (usedColors includes:clr) ifTrue:[ |
4709 (usedColors includes:clr) ifTrue:[ |
4710 newPixel := newColorMap indexOf:clr. |
4710 newPixel := newColorMap indexOf:clr. |
4711 oldToNew at:oldIdx put:newPixel-1. |
4711 oldToNew at:oldIdx put:newPixel-1. |
4712 ] |
4712 ] |
|
4713 ]. |
4713 ]. |
4714 ]. |
4714 |
4715 |
4715 oldBits := oldImage bits. |
4716 oldBits := oldImage bits. |
4716 newBits := ByteArray new:(oldBits size). |
4717 newBits := ByteArray new:(oldBits size). |
4717 depth ~~ 8 ifTrue:[ |
4718 depth ~~ 8 ifTrue:[ |