Method ReadPNG(ImageHandle, CurrentX = 0, CurrentY = 0, Pixel[,] Var) Local X, Y, StartX, StartY, NewPixel[ximagewidth(imagehandle), ximageheight(imagehandle)] Local LeftX, RightX, UpY, DownY 'Start Local Coords:Coords_Class = New Coords_Class Coords = GetFirstEmptyPoint(ImageHandle, Pixel) If Coords.X = -1 Then Return 'End Of Trace StartX = Coords.X StartY = Coords.Y LeftX = StartX RightX = StartX UpY = StartY DownY = StartY NewPixel[StartX, StartY] = OccupiedPix 'A Must Pixel[StartX, StartY] = OccupiedPix 'Not Certain Coords = Null 'Left To Right For Y = StartY To xImageHeight(ImageHandle) - 1 For X = 0 To xImageWidth(ImageHandle) - 1 'Is UnChecked If Pixel[X, Y] = UnChecked Then If HasAnOccupiedPointAroundHim(ImageHandle, X, Y, NewPixel) = True Then If X < LeftX Then LeftX = X If X > RightX Then RightX = X If Y < UpY Then UpY = Y If Y > DownY Then DownY = Y Pixel[X, Y] = OccupiedPix NewPixel[X, Y] = OccupiedPix End If End If 'ForceStop If ForceStopFlg = True Then Return TimedUpdateGraphics() Next Next 'Right To Left And Down To Up For Y = xImageHeight(ImageHandle) - 1 To 0 Step - 1 For X = xImageWidth(ImageHandle) - 1 To 0 Step - 1 'Is Empty If Pixel[X, Y] = UnChecked Then If HasAnOccupiedPointAroundHim(ImageHandle, X, Y, NewPixel) = True Then If X < LeftX Then LeftX = X If X > RightX Then RightX = X If Y < UpY Then UpY = Y If Y > DownY Then DownY = Y Pixel[X, Y] = OccupiedPix NewPixel[X, Y] = OccupiedPix End If End If 'ForceStop If ForceStopFlg = True Then Return TimedUpdateGraphics() Next Next 'Up To Down [All Seems To Work] For X = 0 To xImageWidth(ImageHandle) - 1 For Y = 0 To xImageHeight(ImageHandle) - 1 'Is Empty If Pixel[X, Y] = UnChecked Then If HasAnOccupiedPointAroundHim(ImageHandle, X, Y, NewPixel) = True Then If X < LeftX Then LeftX = X If X > RightX Then RightX = X If Y < UpY Then UpY = Y If Y > DownY Then DownY = Y Pixel[X, Y] = OccupiedPix NewPixel[X, Y] = OccupiedPix End If End If 'ForceStop If ForceStopFlg = True Then Return TimedUpdateGraphics() Next Next 'Down To Up For X = 0 To xImageWidth(ImageHandle) - 1 For Y = xImageHeight(ImageHandle) - 1 To 0 Step - 1 'Is Empty If Pixel[X, Y] = UnChecked Then If HasAnOccupiedPointAroundHim(ImageHandle, X, Y, NewPixel) = True Then If X < LeftX Then LeftX = X If X > RightX Then RightX = X If Y < UpY Then UpY = Y If Y > DownY Then DownY = Y Pixel[X, Y] = OccupiedPix NewPixel[X, Y] = OccupiedPix End If End If 'ForceStop If ForceStopFlg = True Then Return TimedUpdateGraphics() Next Next 'Write The Image Local NewImage = Xcreateimage (RightX - LeftX, DownY - UpY) For Y = UpY To DownY For X = LeftX To RightX If NewPixel[X, Y] = OccupiedPix Then xWritePixel(X - LeftX, Y - UpY, xReadPixel(X, Y, xImageBuffer(ImageHandle)), xImageBuffer(NewImage)) End If 'ForceStop If ForceStopFlg = True Then Return TimedUpdateGraphics() Next Next Return NewImage End Method

Ive added a Tileset in the folder of the Program like this one.. Press LoadTileSet Button and choose this png.. than press ConverToPNGSAfter a while it will turn from a single Image to a multiple PNG Images.

@TomToadNice job - I changed the "show" portion to quickly draw all sprites ... which exposes a flaw in the dark green tile at the bottom right (above the "plus") of the original (see following picture):