Settings

Theme

Ask HN: Image compositing language?

9 points by masonicb00m 7 years ago · 6 comments · 1 min read


Is there a good language for compositing raster graphics? Putting different sub-images in different places, adding text, ... that sort of thing.

gus_massa 7 years ago

I'm not sure if this is what you are looking for, but ImageMagic can do a lot of things like that. See for example https://imagemagick.org/Usage/anim_basics/

Also, you can use the image library of Racket. You can mix bitmaps and vectorial images. See for example the https://docs.racket-lang.org/quick/index.html

rgovostes 7 years ago

Processing -- https://processing.org -- is one of the easiest and most popular languages for doing 2D graphics (and some 3D stuff as well). It's Java based, though there are ports to JavaScript such as p5.js that make it mostly seamless to export your code to the web.

The language and IDE are designed for beginners but it is not limited by it, and in fact many professional designers use it still. The documentation is great, with simple live examples of virtually every function. Here's save() for writing out an image file: https://www.processing.org/reference/save_.html

More recently, they've opened it up to make it easy to get third-party libraries for making web requests, running physics simulations, or augmenting the IDE itself.

bananicorn 7 years ago

Well, SVG, while actually just being XML, supports embedded pngs/jpegs and can be exported to most raster-graphics formats from the command line. Not sure if it's what you're looking for, but personally I love the possibility of being able to scale stuff as I see fit.

pzone 7 years ago

Depends on your use case, but the more common paradigm for reusable and procedural image compositing is the idea of a node graph. Prople prefer to work this way for the interactive visualization. This kind of functionality is found in Natron and Blender (free software) as well as Nuke, Fusion and Houdini (paid.) All of these programs can be scripted with Python.

If you're looking for something to run headless on a server, Imagemagick is a good choice.

  • masonicb00mOP 7 years ago

    Thanks. I didn’t realize Blender did bode graphs—I’ll have to check that out.

    I’ve been using ImageMagick but the CLI invocations are pretty awkward. Maybe I’m just looking for a DSL on top of ImageMagick

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection