You have the integer, now you just need to do some work on it to extract the the flip flags and the global tile ID. This integer is stored in memory in binary form, i.e. as a bunch of bits, just like all other data. But unlike regular numbers, in this case, five separate pieces of data are stored in there: the four flags, and the GID.

Maybe it’ll help to explain this with a decimal example: You might’ve encountered apartment buildings before where the apartments on the first floor are numbered from 101, the ones on the second floor are numbered from 201, the ones on the 3rd floor are numbered from 301, and so on. In this case, the leftmost digit of an apartment number indicates the floor the apartment is on, and only the digits after that are actually numbering apartments. So, “514” means “apartment 14 on the 5th floor”. GIDs work similarly, except with 32 digits (in binary). The first four bits (binary digits) are like the floor numbers, and the rest are the apartment number.

If you just print the GID int, you’ll probably get a decimal representation, which makes it hard to see the structure. But if you look at the binary representation, you can see the leftmost four bits correspond to the flags, and the rest of the bits represent the global tile ID (and these just count up, like the apartment numbers on a given floor).

Just like you can look at a specific digit in a 3-digit apartment number, you can do the same for a specific bit in a binary number. The example code in the documentation shows how to do this using bitmasks, which are the standard technique. A bitmask, just like a masking tape or a paper template, lets you block out the bits you’re not interested in and read only the ones you care about. If you’re interested in how this works, look up bitwise logic - though not a complex topic, it’s nonetheless beyond the scope of a Tiled forum post, and there are many resources that present the ideas in different ways, maybe you’ll find one that clicks for you.

So, in the apartment example, if you wanted to know what floor an apartment is on, you’d check the leftmost digit. Then, to know how far down the hall to go, you’d ignore/clear that leftmost digit and look at just the remaining ones. So, for apartment 514, you’d go to the 5th floor, and then go until you get to the 14th door (or, more realisitcally, until you find the one labelled “514” xP This analogy is imperfect).

In the Tiled case, you want to know what flip flags a tile has, so you check the first four bits. Then, you ignore/clear those and look at the remaining number to get your actual global tile ID.

Hopefully this makes the example code clear. I don’t know what language you’re using, but its syntax for bitwise logic is probably similar, so the example code should serve as decent reference for your code.