e0qdk,
@e0qdk@kbin.social avatar

The Wikipedia article for hqx points out that an implementation exists as a filter in ffmepg.

You can run a command line conversion of e.g. a PNG -> PNG using hqx upscaling like: ffmpeg -i input.png -filter_complex hqx=4 output.png

The =4 is for 4x upscaling. The implementation in my version of ffmpeg supports 2x, 3x, and 4x upscaling.

As a quick and dirty way to get semi-live preview, you can do the conversion with make and use watch make to try to rebuild the conversion periodically. (You can use the -n flag to increase the retry rate if the default is too long to wait.) make will exit quickly if the file hasn't changed. Save the image in your editor and keep an image viewer that supports auto-reload on change open to see "live" preview of the output. (e.g. eog can do it, although it won't preserve size of the image -- at least not in the copy I have, anyway; mine's a bit old though.)

Sample Makefile:

output.png : input.png Makefile
	ffmpeg -y -i input.png -filter_complex hqx=4 output.png

Note the -y option to tell ffmpeg to overwrite the file; otherwise it will stop to ask you if you want to overwrite the file every time you save, and in case you're not familiar with Makefiles, you need a real tab (not spaces) on the line with the command to run.

ffmpeg also appears to support xbr (with =n option as well) and super2xsai if you want to experiment with those too.

I'm not sure if this will actually do what you want artistically, but the existing implementations in ffmpeg makes it easy to experiment with.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • Hentai
  • AskKbin@kbin.social
  • doujinshi
  • announcements
  • general
  • All magazines