PSD (Photoshop, Krita, Gimp...) -> Godot.

Overview

limage v0.2.2

Features Getting Started Tags Settings Todo Customizer Changes Solutions

WARNING: Requires Python to be installed

PSD (Photoshop, Krita, Gimp...) -> Godot.

Example files included. You can delete everything outside the "addons" folder.

Design in your prefered art tool. How you lay it out is how you get it out!
layers1 layers3
Draw origins + spawn points to make life easier.
points1 points2

Auto generate convenient code.

layers2

Tell Godot what kind of node you want the layer to be.
node1 node2

Auto polygon scene generator (WIP)

polygons

Features

  • Convert PSD to images + layer info.
  • Auto-generate scene where layer positions, visibility, and opacity are preserved in Godot.
  • Add origins to make rotations easier.
  • Many image formats, like WEBP.
  • Scale, quantize, and optimize images.
  • Images auto cropped to minimum size.
  • Optionally merge layers at build time, so they can stay seperate in your psd.
  • Only builds if there were changes.
  • Helper scripts:
    • Button: Pixel perfect sprite clicking, without a mask. (Sprite can scale + rotate!).
    • Customizer: Script generator for customizable content.
    • Cursorize: Call set_layer_as_cursor("layer_name") to set any layer as the cursor. (Will use origin to offset).
  • Polygon generator. (WIP! see Tags)

Getting Started

pip3 install psd-tools
  • Create a layered_images folder in Godot. res://layered_images.
  • Add .psd files. (Krita and Gimp can export .psd)
  • Activate the plugin. (Project > Project Settings > Plugins > Limage)
  • Click Limage at top of screen. (next to 2D, 3D, Script, Asset Lib)
  • Click generate.
  • The textures will be placed in a textures folder, and the data in a data folder.

Populating Scene

  • Create a scene in Godot.
  • Add LimageNode.gd script to it.
  • Drag data/name-of-your-psd .tres into the limage field.
  • Click the force_update toggle twice.

That should work. You could remove the LimageNode.gd if you like.

Every time you double click force_update it will update. Useful if you made changes. But it won't delete nodes. You can manually delete all the children to clear, and do a fresh generation.

Tags

Add tags in layer names, between []: layer_name [tag_1 tag2 tag-3]

Use () to set tags for all children. layer_group [tag1] (tag2 tag3)

Use (()) to set tags for all descendants. buttons ((button))

Tags can have values: background [parallax=10] which you can then get in Godot with limage.get_layer("background").tags.get("parallax").

  • x: Completely ignore layer. (Wont export image or layer info.)
  • visible: Will make layer visible, regardless of it's state in the psd.
  • !visible: ^
  • point: Won't generate an image, but will create an empty node in the scene. Useful for spawn points.
  • origin: Sets the origin of the parent group. If no parent, sets the global origin.
  • poly: (WIP!) Will generate a polygon scene. (Requires opencv-python and numpy)
  • button: Makes a clickable sprite button.
  • node: Tells Godot what node to use. my_light [node=Light2D]

These tags can be used on group layers.

  • origins: Children will be treated as points and used for layer origins, for easier rotations + scaling.
  • merge: "Flatten" children into one image.
  • options: Treat children as options for a sprite. (good for customizable objects.)
  • toggles: Treat children as optional child sprites that will be added/removed if enabled/disabled.

Settings

Export settings can be tweaked by including a json file next to the psd, with an identical name.

So next to layered_images/my_picture .psd include layered_images/my_picture .json with your settings.

# default settings
"path": "",						# location of psd if not in directory. (not implemented yet)
"seperator": "-",				# change to "/" and images will be stored in subfolders instead.

"texture_dir": None,			# if set, saves textures here
"data_dir": "data",				# if set, saves layer data here

# rescale textures
"scale": 1,

# in range of 0.0 - 1.0. makes rotation + flipping easier.
# creating a layer with an "origin" tag will replace this. 
"origin": [0, 0],

# you can choose any image format pillow + Godot support.
# but PNG, WEBP, and JPG are probably the most common.
# https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html
# https://docs.godotengine.org/en/stable/getting_started/workflow/assets/importing_images.html
"format": "WEBP", # WEBP can be A LOT smaller than png. and Godot supports it.

# can really decrease file size, but at cost of color range.
# https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.quantize
"quantize": False,

# default texture format settings
"PNG": {
	"optimize": True,
},

"WEBP": {
	"lossless": True,
	"method": 3,
	"quality": 80
},

"JPEG": {
	"optimize": True,
	"quality": 80
}

Todo

  • Better documentation.
  • Finalize polygon generator.
  • Normal map generation.
  • Blend mode shaders.
  • Optional padding for textures.
  • Text placement + preservation. (I only work with krita, which doesn't preserve text info when converting to psd.)

Customizer

If you include an options or toggles tag in any layer, a Godot script will be generated to make layer manipulation easier.

You can then replace LimageNode.gd with it.

You should override this rather than add code to it, as it will be replaced when regenerating.

Changes

0.2.2

  • Added node tag, so you can tell Godot what Node to use.
  • LimageNode now properly uses local coordinates, so it can be a child, rotated, scaled, without problems.
  • LimageNode options and toggles fields now work in editor more stabily.
  • LimageNode toggles initial visibility is fixed.

0.2.1

  • Editor should reload files properly now.

0.2

  • Saving + loading should work better on Windows.
  • Fixed merge tag still generating child textures.
  • Fixed JPEG error because of no alpha channel.
  • Fixed polygon generation not working with some image formats.
  • If settings file is changed, image will be rebuilt.

Solutions

WEBP

If WEBP exporting isn't working, try installing, reinstalling, or updating PILLOW, and/or libwebp:

On Ubuntu:

sudo apt-get install -y libwebp-dev
A minimal python script for generating bip39 seed phrases, and corresponding Seed Signer Seed seed phrase qr code ready for offline printing.

A minimal python script for generating bip39 seed phrases, and corresponding Seed Signer Seed seed phrase qr code ready for offline printing.

CypherToad 8 Sep 12, 2022
Avatar Generator Python

This is a simple avatar generator project which uses your webcam to take pictures and saves five different types of your images into your device including the original image.

Faisal Ahmed 3 Jan 23, 2022
python binding for libvips using cffi

README PyPI package: https://pypi.python.org/pypi/pyvips conda package: https://anaconda.org/conda-forge/pyvips We have formatted docs online here: ht

libvips 467 Dec 30, 2022
Python library that finds the size / type of an image given its URI by fetching as little as needed

FastImage This is an implementation of the excellent Ruby library FastImage - but for Python. FastImage finds the size or type of an image given its u

Brian Muller 28 Mar 01, 2022
Tool to create a Phunk image with a custom background

Create Phunk image Tool to create a Phunk image with a custom background Installation Clone the repo git clone https://github.com/albanow/etherscan_sa

Albano Pena Torres 6 Mar 31, 2022
Simple utility to tinker with OPlus images

OPlus image utilities Prerequisites Linux running kernel 5.4 or up (check with uname -r) Image rebuilding Used to rebuild read-only erofs images into

Wiley Lau 15 Dec 28, 2022
Gallery written in Python to manage your photos

GalleryMan Gallery written in Python to manage your photos Installation

Asian Cat 24 Dec 18, 2022
MaryJane is a simple MJPEG server written in Python.

MaryJane is a simple MJPEG server written in Python.

bootrino 152 Dec 13, 2022
Javascript image annotation tool based on image segmentation.

JS Segment Annotator Javascript image annotation tool based on image segmentation. Label image regions with mouse. Written in vanilla Javascript, with

Kota Yamaguchi 513 Nov 15, 2022
Seaborn-image is a Python image visualization library based on matplotlib and provides a high-level API to draw attractive and informative images quickly and effectively.

seaborn-image: image data visualization Description Seaborn-image is a Python image visualization library based on matplotlib and provides a high-leve

48 Jan 05, 2023
Command line utility for converting images to seamless tiles

img2texture Command line utility for converting images to seamless tiles. The resulting tiles can be used as textures in games, compositing and 3D mod

Artёm IG 24 Dec 26, 2022
The friendly PIL fork (Python Imaging Library)

Pillow Python Imaging Library (Fork) Pillow is the friendly PIL fork by Alex Clark and Contributors. PIL is the Python Imaging Library by Fredrik Lund

Pillow 10.4k Dec 31, 2022
Python wrappers for external BART computational imaging tools and internal libraries

bartpy Python bindings for BART. Overview This repo contains code to generate an updated Python wrapper for the Berkeley Advance Reconstruction Toolbo

Max Litster 7 May 09, 2022
This is an app that allows users to upload photos and display and store the photos in a file until the user deletes them.

Qt Photo App This is an app that allows users to upload photos and display and store the photos in a file until the user deletes them. Setup python3 -

Kathy Yang 5 Jan 22, 2022
This tool allows the user to convert a 16 by 16 image into a list with numbers representing an object/character.

Room Formatter This tool allows the user to convert a 16 by 16 image into a list with numbers representing an object/character. There is cur

Thomas Landstra 1 Nov 13, 2021
Create a 2D mesh for an airfoil in GMSH using python.

GMSHFoil A simple class to create a 2D mesh for an airfoil in GMSH using python. Requirements pip install airfoils

Charilaos Mylonas 1 May 16, 2022
Advance Image Steganography

Chaya Advance Image Steganography Using LSB-LPS + AES-256-GCM + FLIF Right To Privacy! United Nations Declaration of Human Rights (UDHR) 1948, Article

XeroHack 113 Dec 02, 2022
Python scripts for semi-automated morphometric analysis of atolls from Landsat satellite Imagery.

AtollGeoMorph Python scripts for semi-automated morphometric analysis of atolls from Landsat satellite Imagery. The python scripts included allow user

1 Dec 16, 2022
An executor that performs standard pre-processing and normalization on images.

An executor that performs standard pre-processing and normalization on images.

Jina AI 6 Jun 30, 2022
Visage Differentiation is a GUI application for outlining and labeling the visages in an image.

Visage Differentiation Visage Differentiation is a GUI application for outlining and labeling the visages in an image. The main functionality is provi

Grant Randa 0 Jan 13, 2022