anchor.diff:      SetLength(TD,WidthPOT*HeightPOT+1);
       SetLength(TA,WidthPOT*HeightPOT+1);
   
  -    for i:=0 to HeightPOT-1 do begin
  -      ci:=0;
  -      for j:=LeftIndex to RightIndex do
  -        for k:=0 to RXData[aRT].Size[j].X-1 do begin
  -          if i<RXData[aRT].Size[j].Y then begin
  +    for i := 0 to HeightPOT - 1 do
  +    begin
  +      ci := 0;
  +      for j := LeftIndex to RightIndex do
  +        for k := 0 to RXData[aRT].Size[j].X - 1 do
  +        begin
  +          if i < RXData[aRT].Size[j].Y then
  +          begin
               //CopyMemory(TD[(i-1)*WidthPOT+ci-1], RXData[aRT].RGBA[j,(i-1)*RXData[aRT].Size[j].X+k-1], )
               TD[i*WidthPOT+ci] := RXData[aRT].RGBA[j,i*RXData[aRT].Size[j].X+k];
               TA[i*WidthPOT+ci] := (RXData[aRT].Mask[j,i*RXData[aRT].Size[j].X+k] SHL 24) OR $FFFFFF;
  
positive.code: 
  //Export RX to Bitmaps without need to have GraphicsEditor, also this way we preserve image indexes
  procedure TKMSpritePack.ExportToBMP(const aFolder: string);
  var MyBitMap:TBitmap;
      id,i,k:integer;
      sy,sx:integer;
  begin
    ForceDirectories(aFolder);
  
    MyBitMap := TBitmap.Create;
    MyBitMap.PixelFormat := pf24bit;
  
    for id:=1 to RXData[fRT].Qty do
    if RXData[fRT].Flag[id] = 1 then
    begin
      sx := RXData[fRT].Size[id].X;
      sy := RXData[fRT].Size[id].Y;
      MyBitMap.Width  := sx;
      MyBitMap.Height := sy;
  
      for i:=0 to sy-1 do for k:=0 to sx-1 do
        MyBitMap.Canvas.Pixels[k,i] := RXData[fRT].RGBA[id,i*sx+k] and $FFFFFF; //Drop Alpha value
  
      //Mark pivot location with a dot
      {k := sx + RXData[RT].Pivot[id].x;
      i := sy + RXData[RT].Pivot[id].y;
      if InRange(i, 0, sy-1) and InRange(k, 0, sx-1) then
        MyBitMap.Canvas.Pixels[k,i] := $FF00FF;}
  
      if sy > 0 then
        MyBitMap.SaveToFile(aFolder + int2fix(ID, 4) + '.bmp');
  
      SetLength(RXData[fRT].Data[id], 0);
    end;
  
    MyBitMap.Free;
  end;
  
  
  
negative.code:   //#_####a.png - Flag colors areas
    //#_####.txt - Pivot info
  
    for i := 0 to FileList.Count - 1 do
    begin
  
      ID := StrToIntDef(Copy(FileList.Strings[i], 3, 4),0); //wrong file will return 0
  