Open ProGamerGov opened 8 years ago
I have found a working method to crop the image into over lapping crops!
This was done on Ubuntu 14.04.4:
First we need to install the software and it's dependencies:
$ cd ~
$ git clone https://github.com/SpringRoll/image-tiler
$ npm install zpad
$ npm install untildify
$ npm install pngjs
$ npm install png-crop
$ sudo ln -s /usr/bin/nodejs /usr/bin/node
My command structure example:
./index.js --in "~/magick/malibu_Sunset.png" --out ~/magick/zones/ --width 256 --height 256 --overlap 50
The --overlap value is how many pixels of over lap there are between the individual small crops.
Now, the trick is running the images through neural style and then putting them back together.
My attempts at piecing it back together: https://imgur.com/a/50Wvy Using these commands:
montage null: malibu_Sunset_*.png null: \
-tile 5x4 -geometry -56-10 montage_overlap.jpg
And
montage malibu_Sunset_00.png malibu_Sunset_01.png malibu_Sunset_02.png malibu_Sunset_03.png malibu_Sunset_04.png malibu_Sunset_05.png malibu_Sunset_06.png malibu_Sunset_07.png malibu_Sunset_08.png malibu_Sunset_09.png malibu_Sunset_10.png malibu_Sunset_11.png malibu_Sunset_12.png malibu_Sunset_12.png malibu_Sunset_13.png malibu_Sunset_14.png malibu_Sunset_15.png malibu_Sunset_16.png malibu_Sunset_17.png malibu_Sunset_18.png malibu_Sunset_19.png \-mode Concatenate -tile x5 montage_array.jpg
The main issue seems to be that when I add the --overlap value, it creates a few crops that are not the same size as the rest. The -geometry value for putting the images back together seems to have to be less than the --overlap value.
Maybe recombining with a different program would be better?
Making progress!
look at enblend to recombine tiles http://enblend.sourceforge.net/
Tried it. Tiled images need to have alpha chanel to combine them with enblend. Could you explain how to do that? As well as that - it seems that just slicing images and process them throw neural style algorithm with the same style without changing style image or splitting it is able to give a good result
@ProGamerGov how did you run the images through neural style witthout getting different styles for tiles? As far as I understand each tile will be a unique artwork .
@s-a Did you follow the guide on the Neural-Style wiki? The way how you keep the tiles from being random, is you run your image through neural-style first before you chop it up into overlapping tiles. This initial neural-style run's settings should be used for each of the tiles so that the style remains the same.
How did you arrive at your image? Are you using InDesign?
@ProGamerGov I am using the same setup for two tiles in my example but after 1000 iterations they differ as we can see. seems i understand not right... Is It possible to apply learned setting of 1000th iteration for each tile? Then I would expect no random effect.
@s-a Normally I save the tile pieces at 50,150, 250, and 500 iterations, then I piece them together and see which iteration blends the best. I find that depending on the style and settings, the iteration you use for the tiles can vary greatly.
@ProGamerGov i am experimenting with image magic to create a no cost solution. tryied a few variations but get always super ugly edges ;( @jcjohnson any progress out there using tile or another technique?
@s-a There is now a version of Neural-Style which utilizes internal tiling located, here: https://github.com/VaKonS/neural-style. Because the tiling is internal, and due to a few other tricks, it's pretty much impossible to tell where the tile edges are on the output image.
Previously these kinds of things looked ugly due to the bordered between the different tiles. A Reddit user recently came up with a solution to this problem, but there's a catch. Currently the only working method involved use paid Adobe InDesign software. I am told that ImageMagick is capable of the same thing, but we need a working script first. Maybe down the road, Neural-Style can have this built in.
Currently the Neural-Style Wiki only lists the method using InDesign.
Similar to issue: https://github.com/jcjohnson/neural-style/issues/36
Technique described here: https://www.reddit.com/r/deepdream/comments/4qvuju/buscemi_6k/d4yg4qk, and here: https://www.reddit.com/r/imagemagick/comments/4r8h0x/how_to_crop_an_image_into_overlapping_tiles/
From the Reddit post:
Maybe this process could become part