anchor.diff:            MinY := Min(MinY, Y);
             MaxX := Max(MaxX, X);
             MaxY := Max(MaxY, Y);
  +        end;
  +        //Tighter "no shadow" bounds. Also ignore areas where alpha < 50%
  +        if pngBase[Y*pngWidth + X] shr 24 >= $7F then
  +        begin
  +          NoShadMinX := Min(NoShadMinX, X);
  +          NoShadMinY := Min(NoShadMinY, Y);
  +          NoShadMaxX := Max(NoShadMaxX, X);
  +          NoShadMaxY := Max(NoShadMaxY, Y);
           end;
         end;
       end;
  
positive.code:   pngWidth, pngHeight, newWidth, newHeight: Word;
    pngBase, pngShad, pngTeam, pngCrop, pngCropMask: TKMCardinalArray;
    X, Y, MinX, MinY, MaxX, MaxY: Integer;
    StrList: TStringList;
    dirBase, dirShad, dirTeam: string;
  begin
  
negative.code:       StrList.Clear;
        StrList.Append(IntToStr(MinX - pngWidth div 2));
        StrList.Append(IntToStr(MinY - pngHeight div 2));
        StrList.Append(IntToStr(NoShadMinX - MinX));
        StrList.Append(IntToStr(NoShadMinY - MinY));
        StrList.Append(IntToStr(newWidth-1 - (MaxX - NoShadMaxX)));
        StrList.Append(IntToStr(newHeight-1 - (MaxY - NoShadMaxY)));
  
        ForceDirectories(ExeDir+'Sprites\3\');
        StrList.SaveToFile(ExeDir+'Sprites\3\'+format('3_%d.txt', [aPicOffset + Step]));
  