Happy Birthday, MLP:FiM! MLP:FiM turns 9 years old this year! Let's celebrate with an art event!

[Userscript] Transparent Image Background Color Switch

Started by DanielTepesKraus
Posted
7 replies
Login to subscribe to responses
DanielTepesKraus's avatar
Posts: 9837
DanielTepesKraus
GREEN - TALK TO ME
Greatest Poster in the Board
Artist
Derpibooru Premium - Learn about the benefits of subscribing to Derpibooru Premium membership at https://derpibo
Emerald
Speaking Fancy - For helping with translations
Fine Arts - Two hundred uploads with a score of over a hundred (Safe/Suggestive)
A Perfectly Normal Pony - <DrKraus> "Roger Weiner-Asshole One. Out"
The End wasn't The End - Found a new home after the great exodus of 2012
Best Artist - Providing quality, Derpibooru exclusive artwork
An Artist Who Rocks
A Really Classy Artist
Flexible - Bendy pony
Magnificent Metadata Maniac - #1 Assistant
Thread Starter - Started a thread with over 100 pages (/generals/stupid-stuff-that-comes-to-mind-that-we-want-to-post/)
Friendship, Art, and Magic (5 Years) - Celebrated Derpibooru's five year anniversary with friends.
Responsible Disclosure
Not a Llama - I was once a treehouse! I lived in a cake! But I never saw the way, did the orange slay the rake?
Friendship, Art, and Magic (6 Years) - Celebrated Derpibooru's six year anniversary with friends.
Stolen Condensed Milk - Stole a can of Condensed Milk from Glimmer's private stash while she wasn't looking
Equality - Was more equal than the rest of the people during the event and did the only smart thing: wasn't there :^)
Friendship, Art, and Magic (7 Years) - Celebrated Derpibooru's seventh year anniversary with friends
Wallet After Summer Sale

Site Moderator
will return ( ͡° ͜ʖ ͡°)
Description
This simple script adds a "Toggle BG Color" button above all images which allows you to quickly toggle between the light theme and dark theme color for the background of the image. Handy as transparent animated gifs that use aliasing can look bad against the dark theme, and of course some images look better with a dark background. This lets you swap just the image background color itself with the push of a button.

By default the button will always appear in the uploader bar, but you can edit the script and change the value of "AlwaysLink" in the script to set it to only appear on images tagged transparent background or derpibooru theme illusion.

It In Action:


I’ve since given this script a complete rewrite and added a slider bar feature as well. You can use these sliders to tweak the RGB values of the image’s background color and set it to anything you want. Click the down arrow beside the button and go nuts. Again, this feature can be turned off by editing he script and changing the value of "UseSliders":

I mostly added the sliders thing out of boredom / curiosity , but let me know if you find a use for it beyond brief novelty. From what I’ve been told the sliders are only supported by Chrome, Opera, and the newest versions of Firefox, so if they cause your browser problems they can be toggled off (as stated above) or fixed by updating / changing browsers.

Changelog
V1.0 – 2016/03/30 – Initial release
V2.0 – 2017/07/23 – Script rewrite. Now works consistently on all images tagged "transparent", "transparent background", and "derpibooru theme illusion"
V2.1 – 2017/07/23 – Added feature to toggle the script and changed the default setting.
V3.0 – 2017/08/01 – Script rewrite. Added slider function.

Download Link
Download
Download (Kept available because why not?)

Disclaimer and Such
Use at your own risk. This script does not store or access any user data. This script has been tested but may not be entirely bug free.
DanielTepesKraus's avatar
Posts: 9837
DanielTepesKraus
GREEN - TALK TO ME
Greatest Poster in the Board
Artist
Derpibooru Premium - Learn about the benefits of subscribing to Derpibooru Premium membership at https://derpibo
Emerald
Speaking Fancy - For helping with translations
Fine Arts - Two hundred uploads with a score of over a hundred (Safe/Suggestive)
A Perfectly Normal Pony - <DrKraus> "Roger Weiner-Asshole One. Out"
The End wasn't The End - Found a new home after the great exodus of 2012
Best Artist - Providing quality, Derpibooru exclusive artwork
An Artist Who Rocks
A Really Classy Artist
Flexible - Bendy pony
Magnificent Metadata Maniac - #1 Assistant
Thread Starter - Started a thread with over 100 pages (/generals/stupid-stuff-that-comes-to-mind-that-we-want-to-post/)
Friendship, Art, and Magic (5 Years) - Celebrated Derpibooru's five year anniversary with friends.
Responsible Disclosure
Not a Llama - I was once a treehouse! I lived in a cake! But I never saw the way, did the orange slay the rake?
Friendship, Art, and Magic (6 Years) - Celebrated Derpibooru's six year anniversary with friends.
Stolen Condensed Milk - Stole a can of Condensed Milk from Glimmer's private stash while she wasn't looking
Equality - Was more equal than the rest of the people during the event and did the only smart thing: wasn't there :^)
Friendship, Art, and Magic (7 Years) - Celebrated Derpibooru's seventh year anniversary with friends
Wallet After Summer Sale

Site Moderator
will return ( ͡° ͜ʖ ͡°)
bumping this. i gave the code a complete rewrite. it now works consistently on any image tagged "transparent", "transparent background", and "derpibooru theme illusion".

if people like, i could also add a setting to always add the toggle bg link.
done. people pointed out it’s handy for seeing if images need the transparent background tags to begin with.
Interested in advertising on Derpibooru? Click here for information!
Star Easter - Book Print

Derpibooru costs over $25 a day to operate - help support us financially!

Syntax quick reference: *bold* _italic_ [spoiler]hide text[/spoiler] @code@ +underline+ -strike- ^sup^ ~sub~