Resources and Support
 Pixel Joint Forum : The Lounge : Resources and Support
Message Icon Topic: Color cycling in GRAFX2 Post Reply Post New Topic
Author Message
zoe
Seaman
Seaman
Avatar

Joined: 13 February 2015
Online Status: Offline
Posts: 5
Quote zoe Replybullet Topic: Color cycling in GRAFX2
    Posted: 27 February 2015 at 9:43am
Hi everyone! First time in this forum.

I started messing with Grafx2's color cycling feature, and now that I'm done I'd like to save it as a looping .gif file or something. Is it possible? I started the picture in layer mode, so...
IP IP Logged
yrizoud
Commander
Commander
Avatar

Joined: 03 May 2021
Location: France
Online Status: Offline
Posts: 342
Quote yrizoud Replybullet Posted: 27 February 2015 at 1:48pm
If there are several cycling ranges, it can take a very long time for all of them to get synchronized, so the GIF could be impossibly long.
Can you share your image, so that I can have a try ?
IP IP Logged
zoe
Seaman
Seaman
Avatar

Joined: 13 February 2015
Online Status: Offline
Posts: 5
Quote zoe Replybullet Posted: 27 February 2015 at 2:06pm
There are two cycling ranges. One has 12 colors, and the other has 6, so I think I could make them synchronized pretty easily by doubling the second range.

The picture itself is pretty embarrassing and I don't feel very comfy sharing it, unless its absolutely necessary! Since I plan to use the cycling feature a lot in the future I'd rather have it explained.

If its too much to explain, I'm sorry, you're under no obligation to do so :-S Thank you!
IP IP Logged
yrizoud
Commander
Commander
Avatar

Joined: 03 May 2021
Location: France
Online Status: Offline
Posts: 342
Quote yrizoud Replybullet Posted: 27 February 2015 at 3:46pm
The general idea to produce a GIF version is :

Use grafx2 to export the 12 distinct images
1) flatten layers
2) immediately save as frame00.png (for example)
3) open Palette
4) select the color range that you want to scroll forward, except its last color. Ex: if colors 16-31 are scrolling, click color 16 and drag to color 30
5) click Swap button
6) click the second color of the range. In above example: color 17
7) exit Palette (OK) and save the image as frame01.png
repeat steps 3 to 7 until you have produced all the individual images.

Since you have 2 color ranges with 12 and 6 colors , you may want to proceed like this:
frame 00 - initial
frame 01 - shift range A
frame 02 - shift range A and range B
frame 03 - shift range A
frame 04 - shift range A and range B
etc.
By the time you reach frame 11, you will have shifted range A 11 times, and range B 5 times, so it loops.
(edit: Or you can shift each range each time. This way, B is faster, it loops twice)

Produce a GIF animation from this series

For example try http://ezgif.com/maker it seems simple and nice. Upload your 12 frames You can see the resulting animated image in browser, and "save as" on your computer.



Edited by yrizoud - 27 February 2015 at 3:48pm
IP IP Logged
zoe
Seaman
Seaman
Avatar

Joined: 13 February 2015
Online Status: Offline
Posts: 5
Quote zoe Replybullet Posted: 27 February 2015 at 4:10pm
Thank you, yrizoud! I managed to make a .gif in Photoshop.
IP IP Logged
neota
Commander
Commander
Avatar

Joined: 27 November 2018
Online Status: Offline
Posts: 158
Quote neota Replybullet Posted: 27 February 2015 at 8:58pm
Originally posted by yrizoud

The general idea to produce a GIF version is :

Use grafx2 to export the 12 distinct images
1) flatten layers
2) immediately save as frame00.png (for example)
3) open Palette
4) select the color range that you want to scroll forward, except its last color. Ex: if colors 16-31 are scrolling, click color 16 and drag to color 30
5) click Swap button
6) click the second color of the range. In above example: color 17
7) exit Palette (OK) and save the image as frame01.png
repeat steps 3 to 7 until you have produced all the individual images.


This seemed extremely tedious, so I wrote a Python script to automate it.
It's not fully debugged yet, but seems to work for all my test cases.

It generates all the necessary frames, which you then only have to assemble (I'd recommend using gifsicle, personally)

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

ccycle /tmp/anubis4.png /tmp/an.gif 0-23
gifsicle --delay 10 /tmp/an*gif > /tmp/ancycle.gif



It requires Python3 and Pillow.

EDIT: I have now implemented custom offset arrays. Here's a link to an image demonstrating them:

http://imgur.com/V0jj0z4

This simply does several consecutive cyclings at different speeds. the ccycle command used is

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


I just made another example, but won't link it here because it's huge (6mb gif, 240 frames)

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.



Edited by neota - 28 February 2015 at 3:18am
absolutely.
IP IP Logged
zoe
Seaman
Seaman
Avatar

Joined: 13 February 2015
Online Status: Offline
Posts: 5
Quote zoe Replybullet Posted: 28 February 2015 at 7:09am
Thank you for this script! Although I dont really know what Python3 or Pillow is, I'll try my best to figure it out.
IP IP Logged
neota
Commander
Commander
Avatar

Joined: 27 November 2018
Online Status: Offline
Posts: 158
Quote neota Replybullet Posted: 28 February 2015 at 2:50pm
Well, if you are not familiar with the commandline, it may be easier, though tedious, to stick with just GraFX2.
But if you are decided that you want to try my script:

Python 3 is the language that the script is written in, the latest packages for installing that are here . I guess you are probably running Windows -- There are two MSI files in the list of files (one for 32bit windows, one for 64bit windows). One of them should be suitable to install on your system.

Pillow is an imaging library for Python 3. It provides instructions on how to install here. in short, once Python 3 is working, the command
easy_install Pillow

ought to be all that is needed.
Beyond that, I'm not experienced with running python scripts from a Windows console window (cmd.exe), but I gather it works the same way as on Linux. (which is to say, ccycle commands like the ones I wrote above would work as is, providing that the current directory contains the ccycle script.)


Edited by neota - 28 February 2015 at 3:00pm
absolutely.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum