ascompose(3x)

πŸ¦‹ NAME πŸ¦‹

okay so bestie, meet ascompose β€” it's a section 3x page (yes, X11 window manager territory), and what it does is give you access to libAfterImage functionality using scripts you write in the custom XML dialect that lives at libAfterImage/ascompose.

And fr fr, ascompose is a tool to compose image(s) and display/save it based on a supplied XML input file. That's the whole bit. πŸ’…


✨ SYNOPSIS ✨

ascompose -f file|-s string [-o file] [-t type] [-V]
ascompose -i include_file [-i more_include_file ... ]
             -f file|-s string [-o file] [-t type] [-V]
ascompose -f file|-s string [-o file] [-t type] [-V] [-n]
ascompose -f file|-s string [-o file] [-t type [-c compression_level]]
             [-V] [-r]
ascompose [-h]
ascompose [-v]

🌸 DESCRIPTION 🌸

So here's the tea: ascompose reads the XML data you feed it and manipulates the image accordingly. It is lowkey a whole art studio β€” it can transform images from files of any supported file format, draw gradients, render antialiased texturized text, do superimposition of an arbitrary number of images, and save images out into files of any of the supported output file formats. Iconic behavior, honestly. 🎨

At any point, the result of any operation could be assigned a name, and later on referenced under this name. (Name your children, bestie, it pays off. πŸ’–)

At any point during the script processing, the result of any operation could be saved into a file of any supported file types. Yes ma'am. Save early, save often.

Internal image format is 32bit ARGB with 8bit per channel. That's the internal glow-up format. ✨

The last image referenced will be displayed in an X window β€” unless you pass the -n option, in which case it simply won't be. If the -r option is specified, then this image gets displayed in the root window of the X display, which effectively sets a background for a desktop. Main character energy, setting the whole desktop's vibe. And if the -o option is specified, this image will also be saved into the file of the requested type.

ascompose can be compiled to not reference the X Window System at all, which means it can live happily on web servers and any other place you can think of. It does not even require X libraries in that case. Feral in the best way. 🧚


🌈 Supported file types for input

  • XPM β€” via internal code, or the libXpm library.
  • JPEG β€” via the libJpeg library.
  • PNG β€” via the libPNG library.
  • XCF β€” via internal code.
For now XCF support is not complete, as it does not merge layers. 😭 Not the layering, bestie.
  • PPM/PNM β€” via internal code.
  • BMP, ICO, CUR β€” via internal code.
  • GIF β€” via the libungif library.
  • TIFF β€” via the libtiff library (including alpha channel support).

see libAfterImage/ASImageFileTypes for more. πŸ”

πŸ’œ Supported file types for output

  • XPM β€” via internal code, or the libXpm library.
  • JPEG β€” via the libJpeg library.
  • PNG β€” via the libPNG library.
  • GIF β€” via the libungif library.
  • TIFF β€” via the libtiff library (including alpha channel support).

πŸ’… OPTIONS πŸ’…

One bullet per flag, no skips, we're thorough in this house:

  • -h, --help β€” display help and exit. The classic "help me" moment.
  • -f, --file file β€” an XML file to use as input.
  • -s, --string string β€” an XML string to use as input.
  • -n, --no-display β€” don't display the last referenced image. Shy girl behavior, valid.
  • -r, --root-window β€” draw the last referenced image image on the root window.
  • -o, --output file β€” output the last referenced image in to a file. You should use -t to specify what file type to use. Filenames are meaningless when it comes to determining what file type to use β€” so don't come for the extension, it doesn't decide anything. πŸ™ˆ
  • -t, --type type β€” type of file to output to.
  • -c, --compress level β€” compression level.
  • -v, --version β€” display version and exit.
  • -V, --verbose β€” increase verbosity. To increase the verbosity level use several of these, like: ascompose -V -V -V. Stack 'em, bestie. 🫢
  • -D, --debug β€” maximum verbosity β€” show everything and debug messages. Maximum verbosity: achieved.
  • -i, --include file β€” include file as input prior to processing the main file.

πŸŽ€ PORTABILITY πŸŽ€

ascompose could be used both with and without the X window system. It has been tested on most UNIX flavors on both 32 and 64 bit architecture. It has also been tested under CYGWIN environment on Windows 95/NT/2000. She travels. She adapts. She ✨slays✨ on every platform. 🌍


⭐ USES ⭐

  • libAfterImage β€” all the image manipulation routines.
  • libAfterBase β€” Optionally. Misc data handling such as hash tables and console io. Must be used when compiled without X Window support.
  • libJPEG β€” JPEG image format support.
  • libPNG β€” PNG image format support.
  • libungif β€” GIF image format support.
  • libTIFF β€” TIFF image format support.

πŸ‘‘ AUTHOR πŸ‘‘

  • Ethan Fisher β€” <allanon at crystaltokyo dot com>
  • Sasha Vasko β€” <sasha at aftercode dot net>
  • Eric Kowalski β€” <eric at beancrock dot net>
  • libAfterImage/ascompose/sample

Absolute legends, all of them. Periodt. πŸ’–


πŸ”₯ EXAMPLE πŸ”₯

Here is the default script that gets executed by ascompose, if no parameters are given :


πŸ’« SOURCE πŸ’«

#if 1
static char* default_doc_str = "\
<composite op=hue>\
  <composite op=add>\
    <scale width=512 height=proportional>\
        <img id=rose src=rose512.jpg/></scale>\
    <tile width=512 height=384><img src=back.xpm/></tile>\
  </composite>\
  <tile width=512 height=384><img src=fore.xpm/></tile>\
</composite>\
<printf format=\"original image width=%d\n\" var=\"rose.width\"/>\
<printf format=\"original image height=%d\n\" var=\"rose.height\"/>\
<printf format=\ "original image size in pixels=%d\n" val=$rose.width*$rose.height/>";
#else
static char* default_doc_str = "\
  <composite op=add>\
    <scale width=512 height=proportional>\
        <img id=rose src=rose512.jpg/></scale>\
    <tile width=512 height=384><img src=back.xpm/></tile>\
  </composite>";
#endif

and that's the whole page, bestie β€” from the 3rd Berkeley Distribution, this is AfterStep v.2.2.12, and the page is ascompose(3x). go compose something gorgeous with it πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from