def ExportImage(filename):
    path, base_name = os.path.split(filename)
    base_name, ext = os.path.splitext(base_name)
    path = os.path.abspath( path )
    dest_filename = os.path.join(path, base_name+".tex")

    if util.IsAnyFileNewer( filename, dest_filename ) or args.force:
        im = Image.open( filename )
        sz = im.size
        print( "\tExporting " + filename + " to " + dest_filename)
        assert sz[0] %4 == 0 and sz[1] %4 == 0, "Image " + filename + " has a dimension that is not a multiple of 4"

        skipmip = not is_power2(sz[0]) or not is_power2(sz[1])

        textureconverter.Convert( src_filenames=filename, dest_filename=dest_filename,
                force=args.force, texture_format=args.textureformat, platform=args.platform,
                generate_mips=not skipmip, no_premultiply=im.mode=='RGB', ignore_exceptions=args.ignoreexceptions )

#parse args
dataset/ETHPy150Open kleientertainment/ds_mod_tools/pkg/cmn/mod_tools/compiler_scripts/image_build.py/ExportImage/original