def texture(
    mat,
    texture,
    location,  # Upper-right corner of the TexImage node
    label,  # Label for the TexImg node
    color_socket=None,
    alpha_socket=None,
    is_data=False,
):
    """Creates nodes for a TextureInfo and hooks up the color/alpha outputs."""
    x, y = location

    # Image Texture
    tex_img = mat.node_tree.nodes.new("ShaderNodeTexImage")
    tex_img.location = x - 240, y
    tex_img.label = label
    tex_img.image = texture

    # Set colorspace for data images
    if is_data:
        if tex_img.image:
            tex_img.image.colorspace_settings.is_data = True

    # Outputs
    if color_socket is not None:
        mat.node_tree.links.new(color_socket, tex_img.outputs["Color"])
    if alpha_socket is not None:
        mat.node_tree.links.new(alpha_socket, tex_img.outputs["Alpha"])

    return tex_img