Auto4: Gradient Factory

Discuss and get help for karaoke effect creation here

Auto4: Gradient Factory

Unread postby ai-chan » Sat Feb 14, 2009 3:55 pm

It's been a while since I last coded Auto4/Lua macro, so here comes my new masterpiece ...

Gradient Factory

Gradient Factory generates color gradient, just like many gradient karatemplates out there, but unlike the latter Gradient Factory is a macro, not a karatemplate, so it does not require adding template lines into the subtitles. Moreover, it's highly configurable, thanks to Auto4/LUA superb configuration dialogue support.

Image

Gradient Factory requires at least Aegisub 2.1.3. Aegisub 2.1.2 does not support color picker buttons in configuration dialogue.

To use it, first download attached gradient-factory.lua into automation/autoload folder. Aegisub will autoload the script and add two commands into the Automation menu: "Generate color gradient" and "Un-gradient"

If you want to apply color gradient to a certain set of lines, select them first. Otherwise, invoke "Generate color gradient" to get configuration dialogue like above:
  • Apply to - the line criteria to apply the gradient to
  • Mode - select among Smooth, Vertical, Character-based and Syllable-based gradient
  • Pixel per strip - for smooth & vertical modes, subtitle lines are broken into strips, each assigned with different colors. Set how many pixels the width/height of each strips (the smaller, the smoother but the more rendering power needed)
  • Karaoke - for lines with karaoke tags, you can choose whether to strip them out or use specific karaoke tag (\k or \kf or \ko)
  • Primary / Secondary / Outline / Shadow - Use the color picker buttons to pick colors

The "Un-gradient" command undoes gradient lines generated using smooth and vertical modes. You need to select a generated line to enable this command.

Gradient Factory remembers previous configurations as well as stores them into the subtitle file.

Any feedbacks will be appreciated. Enjoy!

WARNING! WARNING! WARNING!

Do not apply Gradient Factory on lines generated by kara templates. Likewise, do not apply kara templates on lines generated by Gradient Factory. They are not incompatible with each other.

Unfortunately with current ASS version, it is very difficult or even next to impossible to make gradient and advanced karaoke effects work together on the same subtitle line. This is because the gradient produced by Gradient Factory is, in a sense, an advanced effects (minus the karaoke). Like many advanced karaoke generators out there, be it karatemplates or LUA scripts, Gradient Factory works on the subtitle lines that have been stripped of all advanced effects, save for the native karaoke tags. Likewise, if you create the gradient first and then apply a karatemplate on a subtitle line, you'll lose the gradient, unless the karatemplate spefically leaves the original effects intact. Gradient Factory, however, can't do that because of the way it works. Unless you create a karatemplate / LUA script that specifically creates your advanced effect plus the gradient, that's how current automation work.

Updates:

1.2 - 19 Feb 2009

- Now Gradient Factory detects and preserves \pos and \move tags from original lines and considers their coordinates in the calculations. Both \move tags with and without optional 5th and 6th parameters are supported.
- Fixed a bug in the "-colors" button
- Added a new "karaoke" option: "As Is" .. which leaves whatever types of karaoke tags from original syllables

1.1 - 16 Feb 2009

- Added buttons to add/reduce color picker buttons (for more than 3 colors gradients)
- Changed the color picker buttons layout
- Improved the algorithm for more accurate gradient colors
Attachments
gradient-factory-1.3.lua
(24.88 KiB) Downloaded 6802 times
gradient-factory.lua
(21.36 KiB) Downloaded 27944 times
gradient-factory-1.2.lua
(23.81 KiB) Downloaded 32120 times
Last edited by ai-chan on Thu Feb 26, 2009 1:54 pm, edited 1 time in total.
- ASSDraw3
- Jumping Blob v2
- KaraTemplater Showcase
- Gradient Factory

I am no longer working on karatemplaters so keep your requests to yourself, or try asking someone else to do them for you.
User avatar
ai-chan
{\clip\t(\clip)}
{\clip\t(\clip)}
 
Posts: 421
Joined: Wed Jan 25, 2006 2:34 am
Location: Malaysia

Re: Auto4: Gradient Factory

Unread postby Bocom » Sat Feb 14, 2009 4:18 pm

Awesome work! :D

This will certainly be useful for m in the future. :)
Bocom
{\move}
{\move}
 
Posts: 38
Joined: Sat Dec 06, 2008 9:21 pm

Re: Auto4: Gradient Factory

Unread postby jfs » Sat Feb 14, 2009 5:53 pm

A tip for how you might be able to enhance it further at some point:
Instead of having at most 3 colours for each gradient and a dropdown to select how many, instead have a + and a - button for each, the button closes the dialogue but then increases/decreases the number of colours for that part and opens a new dialogue with more buttons for it. It should be possible to do, though I wonder if the open/close flickering will be too much.
Do not PM me asking for help with Aegisub, Automation, karaoke or anything like that, I won't reply.
Ask your questions in the public forums. Use the Search function, somebody probably asked the same question before.
All rights reserved to call you insults if you ask poorly thought out or redundant questions.
Experimenting is free and is a great way to learn things.
User avatar
jfs
Developer
 
Posts: 2994
Joined: Mon Dec 19, 2005 8:18 pm
Location: Denmark

Re: Auto4: Gradient Factory

Unread postby eiv » Sun Feb 15, 2009 1:51 pm

Very nice.
eiv
Comic Sans MS
Comic Sans MS
 
Posts: 3
Joined: Tue Oct 21, 2008 8:22 pm

Re: Auto4: Gradient Factory

Unread postby Gelion » Sun Feb 15, 2009 9:21 pm

Simply impressive... No more comments...
Gelion
{\b1}
{\b1}
 
Posts: 22
Joined: Mon Dec 15, 2008 11:03 pm

Re: Auto4: Gradient Factory

Unread postby zheo » Sun Feb 15, 2009 11:46 pm

fantastic!!!!!  ;D great work!!!
User avatar
zheo
{\clip\t(\clip)}
{\clip\t(\clip)}
 
Posts: 142
Joined: Sat Aug 02, 2008 1:42 am

Re: Auto4: Gradient Factory

Unread postby ai-chan » Mon Feb 16, 2009 12:55 pm

Version 1.1 is up (download from the first post attachment). Now supports more than 3 color gradients, thanks to jfs for suggestion.  ;D
- ASSDraw3
- Jumping Blob v2
- KaraTemplater Showcase
- Gradient Factory

I am no longer working on karatemplaters so keep your requests to yourself, or try asking someone else to do them for you.
User avatar
ai-chan
{\clip\t(\clip)}
{\clip\t(\clip)}
 
Posts: 421
Joined: Wed Jan 25, 2006 2:34 am
Location: Malaysia

Re: Auto4: Gradient Factory

Unread postby ai-chan » Thu Feb 19, 2009 3:22 am

Version 1.2 is up (download gradient-factory-1.2.lua from first post attachment). Now preserves \pos and \move tags from original lines.
- ASSDraw3
- Jumping Blob v2
- KaraTemplater Showcase
- Gradient Factory

I am no longer working on karatemplaters so keep your requests to yourself, or try asking someone else to do them for you.
User avatar
ai-chan
{\clip\t(\clip)}
{\clip\t(\clip)}
 
Posts: 421
Joined: Wed Jan 25, 2006 2:34 am
Location: Malaysia

Re: Auto4: Gradient Factory

Unread postby GTO » Fri Feb 20, 2009 6:59 am

Superb Script ai-chan ... you're awesome ^^

suggestion:
- how about adding fade in and fade out for the line
Last edited by GTO on Fri Feb 20, 2009 7:29 am, edited 1 time in total.
GTO
{\b1}
{\b1}
 
Posts: 15
Joined: Thu Feb 15, 2007 10:13 am

Re: Auto4: Gradient Factory

Unread postby ai-chan » Fri Feb 20, 2009 7:47 am

GTO wrote:suggestion:
- how about adding fade in and fade out for the line

I believe that is unrelated what gradient is about. I won't add features that are not related to gradients. (If you are wondering why I added the support for \pos and \move tags, it is because the two tags modify the position of the subtitle on the screen and since the way smooth gradient is generated is very sensitive to positioning, it makes sense to take the \pos and \move tags into consideration when doing the calculation)

Btw, to add {\fad(500,500)} to selected lines, go to menu Edit > Search and Replace:

- Find what: ^
- Replace with: {\\fad(500,500)}
- Tick "Use regular expressions"
- In Field: Text
- Limit to: All rows

Remember, Automation should only be used when things cannot (or are very time-consuming to) be done the manual ways. Explore Aegisub to the fullest before stepping into the world of Automation.
- ASSDraw3
- Jumping Blob v2
- KaraTemplater Showcase
- Gradient Factory

I am no longer working on karatemplaters so keep your requests to yourself, or try asking someone else to do them for you.
User avatar
ai-chan
{\clip\t(\clip)}
{\clip\t(\clip)}
 
Posts: 421
Joined: Wed Jan 25, 2006 2:34 am
Location: Malaysia

Re: Auto4: Gradient Factory

Unread postby $kroutz » Sat Feb 21, 2009 12:18 pm

Hi , I noticed that when you produce gradients you can't keep and the automation generated effects..Or am I doing something wrong?Is there a way to bypass it?
$kroutz
{\move}
{\move}
 
Posts: 27
Joined: Fri Feb 20, 2009 6:34 pm

Re: Auto4: Gradient Factory

Unread postby ai-chan » Sat Feb 21, 2009 12:45 pm

Unfortunately with current ASS version, it is very difficult or even next to impossible to make gradient and advanced karaoke effects work together on the same subtitle line. This is because the gradient produced by Gradient Factory is, in a sense, an advanced effects (minus the karaoke). Like many advanced karaoke generators out there, be it karatemplates or LUA scripts, Gradient Factory works on the subtitle lines that have been stripped of all advanced effects, save for the native karaoke tags. Likewise, if you create the gradient first and then apply a karatemplate on a subtitle line, you'll lose the gradient, unless the karatemplate spefically leaves the original effects intact. Gradient Factory, however, can't do that because of the way it works. Unless you create a karatemplate / LUA script that specifically creates your advanced effect plus the gradient, that's how current automation work.
- ASSDraw3
- Jumping Blob v2
- KaraTemplater Showcase
- Gradient Factory

I am no longer working on karatemplaters so keep your requests to yourself, or try asking someone else to do them for you.
User avatar
ai-chan
{\clip\t(\clip)}
{\clip\t(\clip)}
 
Posts: 421
Joined: Wed Jan 25, 2006 2:34 am
Location: Malaysia

Re: Auto4: Gradient Factory

Unread postby KGSubs » Tue Feb 24, 2009 2:05 am

thanks ai-chan.....  ;D
Naruto Fansubber
KGSubs Fangroup
User avatar
KGSubs
Comic Sans MS
Comic Sans MS
 
Posts: 4
Joined: Fri Feb 06, 2009 5:33 am
Location: India

Re: Auto4: Gradient Factory

Unread postby HateM » Thu Feb 26, 2009 12:11 pm

Aichan, you're so greattttt xDDD
I'm loving playing with gradients xDDD

Thanks for always coming up with new cool stuffs for my subs  :-* :-*
HateM
{\b1}
{\b1}
 
Posts: 16
Joined: Fri Jun 06, 2008 10:58 pm

Re: Auto4: Gradient Factory

Unread postby ASEDARK » Mon Mar 16, 2009 8:25 am

fantastic tool friend, gradient is very fun and util
ASEDARK
{\b1}
{\b1}
 
Posts: 23
Joined: Tue Feb 03, 2009 11:43 am

Next

Return to Karaoke

Who is online

Users browsing this forum: No registered users and 2 guests