Yoshi Art Project

After coding up the simple wrapper for the neural-style-tf package (described in this post), I put it to use to stylize one of my favorite videogame characters: Yoshi.

Development

The development of this idea is fairly straighforward, I just gathered a lot of styles and textures I wanted to try, placed them in a folder and ran the neural-style automator. The image I chose to use was the following:

This image was selected due to its simplicity and small size, so that it didn’t take forever to run on the stylizer (given that I currently have no access to a GPU). Textures and paintings with lots of turns and colors seemed to work the best. A sample of this is shown next:

After running the automated style-transfer script as described in this post, we take the resulting images from a directory:

SetDirectory[NotebookDirectory[]]
folders = FileNames["./out/yoshiSide*"][[2 ;; All]]
rawImage = Import["./yoshiSide.png"];

Compose them with a 20% opacity version of the original image as an overlay (to make it look a bit better):

yoshis = Table[
  file = FileNames[folders[[i]] <> "/result/result.png"];
  If[Length[file] > 0,
    probe = Import[file[[1]]];
    composed = ImageCompose[probe, {rawImage, .2}] // ImageAdjust;
    {StringSplit[file, "/"][[1, -3]], composed},
    Unevaluated@Sequence[]
  ]
  , {i, 1, Length[folders]}];

Generate a grid, and export:

{c, r} = {8, 8}
img = ImageAssemble[
   Partition[
     Flatten[{yoshis[[All, 2]], yoshis[[All, 2]]}][[1 ;; 140]], 10] //
     Transpose];
Export["yoshiGrid.png", img];

Which results in the following:

Documentation and Code