You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Give the user the option to export a texture, built from patches, as an Image(). Currently omgifol users have to manually traverse the data and build patches themselves, but this should be an in-built feature of omgifol.
My current implementation (including transparency fix in issue #17) is as follows:
wad = omg.WAD(path)
tex = omg.txdef.Textures(wad.txdefs)
# build the textures out of the patches
for texturedef in tex:
new_img = Image.new("RGBA", (tex[texturedef].width, tex[texturedef].height))
for p in tex[texturedef].patches:
pimg = wad.patches[p.name.upper()].to_Image()
pimg = pimg.convert("RGBA")
# try and fix transparency issues
pixdata = pimg.load()
width, height = pimg.size
for y in xrange(height):
for x in xrange(width):
if pixdata[x, y] == (255, 0, 255, 255):
pixdata[x, y] = (255, 255, 255, 0)
new_img.paste(pimg, (p.x, p.y), pimg)
but this should be as simple as follows:
wad = omg.WAD(path)
tex = omg.txdef.Textures(wad.txdefs)
# get the textures
for texturedef in tex:
new_img = tex[texturedef].to_Image()
The text was updated successfully, but these errors were encountered:
Give the user the option to export a texture, built from patches, as an Image(). Currently omgifol users have to manually traverse the data and build patches themselves, but this should be an in-built feature of omgifol.
My current implementation (including transparency fix in issue #17) is as follows:
but this should be as simple as follows:
The text was updated successfully, but these errors were encountered: