colorshift icon indicating copy to clipboard operation
colorshift copied to clipboard

I don't know code and can't do it

Open itripley opened this issue 7 years ago • 1 comments

I just want to fuck up an image but I don't know what to type in cmd

itripley avatar Nov 05 '18 02:11 itripley

Hello! I’m assuming you have Python 3 installed and you’ve downloaded the code as a zip and extracted it… somewhere?

Here’s what you’ll need to run it. cmd is a bit like a file explorer, but it can also run programs! In the examples below, > indicates a “prompt line” (meaning you should type the rest of the line and hit enter) and other lines are program output.

First, you’ll want to cd (change directory) (I recommend reading that link) to wherever you’ve put the code. That’ll probably look (something) like:

> cd %USERPROFILE%\Downloads\colorshift

Then, type dir to see what files are in the current directory:

> dir
 Volume in drive C has no label.
 Volume Serial Number is 1654-B5B4

 Directory of C:\Users\arvensis\Downloads\colorshift

11/05/2018  10:16 AM    <DIR>          .
11/05/2018  10:16 AM    <DIR>          ..
11/05/2018  10:16 AM                 8 .gitignore
11/05/2018  10:16 AM             6,956 colorshift.py
11/05/2018  10:16 AM             1,379 readme.md
11/05/2018  10:16 AM             1,442 score.py
               4 File(s)          9,785 bytes
               2 Dir(s)  66,442,952,704 bytes free

You’ll also need the Pillow Python library:

> pip install Pillow
Collecting Pillow
  Downloading https://files.pythonhosted.org/packages/55/ea/305f61258278790706e69f01c53e107b0830ea5a4a69aa1f2c11fe605ed3/Pillow-5.3.0-cp37-cp37m-win_amd64.whl (1.6MB)
    100% |████████████████████████████████| 1.6MB 1.7MB/s
Installing collected packages: Pillow
Successfully installed Pillow-5.3.0

Now you’re ready to run colorshift. Keep in mind that I didn’t write the code, so I’m not actually too familiar with its usage, but we can see a somewhat informative message by adding --help when we run it:

> python colorshift.py --help
usage: colorshift.py [-h] [--order ORDER ORDER ORDER] [--hsv] [--sort]
                     filename colorsize

Fuck up an image

positional arguments:
  filename              File to fuck
  colorsize             Minimum: ceil(cbrt(width*height)) - color resolution

optional arguments:
  -h, --help            show this help message and exit
  --order ORDER ORDER ORDER
                        Order to check cells in, default 0 1 2
  --hsv                 Use HSV instead of RGB
  --sort                Sort a thing. Time consuming, but cool

Stuff that goes in square brackets is optional. I’ve saved an image as my_image.jpg in the same folder as the code, so I can fuck it up with:

> python colorshift.py my_image.jpg 10

That last number isn’t optional, and I don’t really understand it. The bigger it is the slower the program runs — I think it sorts a lot of data under the hood…? It seems to be related to color depth, so it’s almost certainly useless to make it bigger than 256 (for… reasons).

When you finish running it, colorshift should open your result image and save it as a .bmp automatically.

Does that help? Getting it to look cool is… difficult. Maybe I’ll sort through the code and write a guide one of these days…

If you get the code working, please close this issue. Thanks!

9999years avatar Nov 05 '18 15:11 9999years