From png to txt and then to tmx

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
namespace
Posts: 2
Joined: 2019-01-13T06:53:40-07:00
Authentication code: 1152

From png to txt and then to tmx

Post by namespace » 2019-01-14T08:39:45-07:00

Hi, I wanted to know if it's possible to go from png to txt and then to tmx. I want to convert a png image to a tilemap.
In my case I want to store on the txt file only the data of the rgb part of the png ignoring the alpha/transparent part.
Do you think it's possible?
Or is it possible to go directly from png to tmx?

snibgo
Posts: 12029
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: From png to txt and then to tmx

Post by snibgo » 2019-01-14T08:46:57-07:00

TMX is not a format listed in "magick -list format".
snibgo's IM pages: im.snibgo.com

namespace
Posts: 2
Joined: 2019-01-13T06:53:40-07:00
Authentication code: 1152

Re: From png to txt and then to tmx

Post by namespace » 2019-01-14T09:59:06-07:00

So is it possible to do a conversion from png to txt separating the colored part from the alpha channel?

snibgo
Posts: 12029
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: From png to txt and then to tmx

Post by snibgo » 2019-01-14T10:49:27-07:00

The colour RGB channels with no alpha:

Code: Select all

magick toes_holed.png -alpha off txt:
Just the alpha:

Code: Select all

magick toes_holed.png -alpha extract txt:
snibgo's IM pages: im.snibgo.com

Post Reply