AuthorTopic: Official Off-Topic Thread 2015  (Read 92376 times)

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: Official Off-Topic Thread 2015

Reply #160 on: February 28, 2015, 08:18:17 am
This doesn't seem offtopic enough, so I guess it's OT for this thread :

I wrote a color-cycle expander. That is, you give it an image and tell it what areas of the palette to cycle, and it works out how many frames that will take and renders them all to a sequence of images, which you can then assemble into an animated gif or spritesheet.
It was prompted by this post on PJ about rendering colorcycling as an image sequence.

It requires Python 3 and Pillow.


The script is here
(or raw here)


It's not ready for formal release yet: I want to improve help and error handling first. That's why it's only on bpaste for now.

Example output animation:

created with
Code: [Select]
ccycle /tmp/anubis4.png /tmp/an.gif 0-23
gifsicle --delay 10 /tmp/an*gif > /tmp/ancycle.gif

Here's another example demonstrating custom cycling sequences.
This second example simply does several consecutive cyclings forward at different speeds. the ccycle command used is
Code: [Select]
ccycle /tmp/anubis4.png /tmp/ar.gif 0-23:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,2,4,6,8,10,12,14,16,18,20,22,0,4,8,12,16,20,0,8,16

It supports any of the following forms of specifying cycling:

* '0-2' cycles the first three colors in the palette, one step forward per frame.
* '0-2:-1' cycles them backward once per frame
* '0-2:2' cycles them forwards 2 steps per frame
* '0-2:1/3' cycles them forwards 1 step every 3 frames.
* '0-2:-1/3' cycles them backwards 1 step every 3 frames.
* '0-2:0,1,2,1' cycles forward then backward (ping-pong), over 4 frames (explicit offsets given)

and as many cycling regions as needed (automatically synchronized and rendered over an appropriate number of frames to give a correct looping.)

EDIT:

I just made another example, but won't link it here because it's huge (6mb gif, 240 frames)
Code: [Select]
ccycle /tmp/anubis4.png /tmp/ac.gif 0-7 8-11:1/2 12-16:1/3 17-20:-1/4 21-23:1/5

this one:
* cycles 0-7, 1 step per frame
* cycles 8-11, 1 step every 2nd frame
* cycles 12-16, 1 step every 3rd frame
* cycles 17-20 backwards, 1 step every 4th frame
* cycles 21-23, 1 step every 5th frame.
« Last Edit: February 28, 2015, 11:17:29 am by Ai »
If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.

Offline surt

  • 0011
  • **
  • Posts: 570
  • Karma: +0/-0
  • Meat by-product
    • not_surt
    • http://pixeljoint.com/p/2254.htm
    • View Profile
    • Uninhabitant

Re: Official Off-Topic Thread 2015

Reply #161 on: February 28, 2015, 11:33:30 pm
Did some more work on my colour cube toy: http://img.uninhabitant.com/colourcube.html
Auto update preview.
Added HSV/HSL colour spaces.
Gain/bias adjustment.
Gimp palette and JASC palette export.
Call it finished I think.

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: Official Off-Topic Thread 2015

Reply #162 on: March 01, 2015, 01:32:16 am
Did some more work on my colour cube toy: http://img.uninhabitant.com/colourcube.html
Auto update preview.
Added HSV/HSL colour spaces.
Gain/bias adjustment.
Gimp palette and JASC palette export.
Call it finished I think.
* GPL export is pretty neat.

* I can't get HSV/HSL/CMYK/Gray to work : the color cube simply doesn't update (also, the component order selectors still show R G B rather than HSL or whatever, but I figured that might just be a cosmetic bug). If I manually click Update, it reloads the page and sets the colorspace to RGB.

* Bits works okay for RGB, other options(levels/step/custom) do not appear to affect the display. Hitting update just reloads the page with default settings. These numeric selectors also are limited to a maximum of 8, which suggests to me that they are not being updated when levels, step, or custom is selected, either.

* If you ever get curious about it, HSI might be an interesting option. Photoshop and MyPaint use it for colorization, because it performs far better at maintaining perceptual brightness as you change hue/saturation than HSV or HSL do.

* Gain/bias are basically equivalent to contrast/brightness controls, so it might be more artist-friendly to rename them accordingly.

EDIT: the two problems above do not occur on Midori, only Firefox. Not sure what to conclude about that yet.
« Last Edit: March 01, 2015, 02:33:50 am by Ai »
If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.

Offline surt

  • 0011
  • **
  • Posts: 570
  • Karma: +0/-0
  • Meat by-product
    • not_surt
    • http://pixeljoint.com/p/2254.htm
    • View Profile
    • Uninhabitant

Re: Official Off-Topic Thread 2015

Reply #163 on: March 01, 2015, 02:40:27 am
Oops. Should test in Firefox on occasion. Wasn't specifying the event args on a couple of event handlers, which chrome seems to be fine with (Midori is WebKit based too).
Those problems should be cool now.

Isn't HSI just another name for HSV? Intensity = Value?

I was thinking about HSY (Y being perception weighted brightness), but I couldn't find it described in code, just maths which hurts my brain.
« Last Edit: March 01, 2015, 02:44:17 am by surt »

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: Official Off-Topic Thread 2015

Reply #164 on: March 01, 2015, 05:13:59 am
Oops. Should test in Firefox on occasion. Wasn't specifying the event args on a couple of event handlers, which chrome seems to be fine with (Midori is WebKit based too).
Those problems should be cool now.

Isn't HSI just another name for HSV? Intensity = Value?

I was thinking about HSY (Y being perception weighted brightness), but I couldn't find it described in code, just maths which hurts my brain.

Hmm. Seems like HSY is actually what I meant -- it seems to be what MyPaint's code refers to.

HSI is not the same as HSV though, http://en.wikipedia.org/wiki/HSL_and_HSV shows a comparison of a fireball that demonstrates that hsV, hsL, hsI, hsY and Lab are all different.

I suggest you check out the HCY_to_RGB + RGB_to_HCY functions in gui/colors/uicolor.py of the MyPaint source tree. To me, the RGB_to_HSY function seems very similar to RGB->HSL conversion, pretty simple. It will probably produce best results if you convert your sRGB values to linear RGB first. The HSY_to_RGB function is roughly on the same order of complexity as a HSL to RGB transform, too (and of course the inverse applies: convert the linear RGB values to sRGB afterwards)

It also includes RGB_to_YCbCr_BT601 and YCbCr_BT601_to_RGB,  which are quite simple and relevant to NES-like colorspaces.

I can confirm the different colorspaces seem to be working fine now.
« Last Edit: March 01, 2015, 05:27:10 am by Ai »
If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.

Offline Friend

  • 0010
  • *
  • Posts: 288
  • Karma: +1/-0
    • View Profile

Re: Official Off-Topic Thread 2015

Reply #165 on: March 04, 2015, 02:44:49 pm
does anyone know of a sort of 3d virtual cube that can be rotated?  Im trying to practice drawing cubes from any perspective and am having trouble getting a feel for how much edges should converge.  :'(

Offline Mr. Fahrenheit

  • 0010
  • *
  • Posts: 326
  • Karma: +0/-0
    • View Profile

Re: Official Off-Topic Thread 2015

Reply #166 on: March 04, 2015, 10:30:38 pm
I'm not sure if there are any online, but you could always load one up in blender.

Offline 32

  • 0011
  • **
  • Posts: 535
  • Karma: +1/-0
    • @AngusDoolan
    • http://pixeljoint.com/p/19827.htm
    • View Profile

Re: Official Off-Topic Thread 2015

Reply #167 on: March 04, 2015, 11:42:54 pm
Yeah if you've got a 3d program that's the easiest way to go. Alternately I found this, has some pretty extreme 3 point perspective going on but the code is editable so maybe you can change it somewhere in there.

Offline Friend

  • 0010
  • *
  • Posts: 288
  • Karma: +1/-0
    • View Profile

Re: Official Off-Topic Thread 2015

Reply #168 on: March 05, 2015, 12:00:08 am
Thanks Mr. Fahrenheit and 32.  I have another random question...

Do you artists actually see images in your head before you draw them?  I've been a musician for years and 24/7 have a song playing through my head that is sensitive to all timbres, subtle peculiarities, every note.

But for the life of me I just don't see images in my head.  Is it absurd to have a passion to learn to draw if I don't see mental pictures?

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: Official Off-Topic Thread 2015

Reply #169 on: March 05, 2015, 01:09:24 am
Sometimes. But it's not a persistent thing. My opinion is that graphics are too complex (and our visual imaginations too simplified) to have that kind of experience with them. I can imagine an animation sequence, for example, if I actively focus on it,  but when not specifically focused on it, the best I get are visual 'flashes' (which can be quite intense but usually are rather unsophisticated.)
If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.