Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> [Script] Copying decensors into multiple languages quickly

 
post Apr 18 2017, 03:34
Post #1
Superlatanium



Dreaming of optimizing the system
*********
Group: Gold Star Club
Posts: 7,489
Joined: 27-November 13
Level 500 (Godslayer)


Some of you have probably seen my recent galleries of decensored works in multiple languages. I've been doing this with a script I wrote and thought I'd share, some people have expressed interest. After all, the more decensored galleries, the better. If an English version of a gallery has been decensored, there's no reason why the Japanese, Chinese, Korean, and Spanish versions shouldn't be decensored as well, if the decensor can be copied quickly - which it can, using this tool. (tl;dr, it lets you do [reasoningtheory.net] this, at that speed)

(Don't worry, you don't need to know the first thing about decensoring to use this! But you do need to have a bit of software/programming intuition)

The script is written in AutoHotkey (in Windows), and uses Photoshop. I am using Windows 7 and Photoshop CS6. It probably works on other versions of Windows and other versions of Photoshop too, but if it doesn't, it should be pretty easy to fix by making a few minor changes to the AHK script. This being AHK based, it will unfortunately likely have some compatibility problems depending on the layout of windows on your screen, but it's worth it if you want to be able to copy decensors quickly.

(1) How copying a decensor works:
If you don't know already, manually, the process of copying a decensor involves something similar to the following:
(*) Find a decensored version of a gallery and a censored version of the gallery in a different language.
The versions should use the same source/scan, without any cropping differences. This way, the decensored pixels can be copied to the same location on the censored gallery. They don't necessarily need to be the same resolution as long as the aspect ratios match. Example: This decensored gallery uses 975 x 1400 while this censored gallery uses 1114 x 1600, but they're based on the same scan and have the same aspect ratio, so if the larger image is downscaled, they'll match up perfectly, and the decensor can be copied. (You can also upscale the smaller image, but that usually looks worse) On the other hand, this decensored version uses cropping different from this censored version, so copying the decensor quickly would be too difficult, requiring you to manually orient/crop/align every page. If the versions use the same page dimensions but are leveled differently, it's still OK: example, [decensored] + [censored, overleveled] = [decensored, overleveled]
(*) For each page in the gallery:
  • Open the censored page and the decensored page.
  • If any page uses Indexed color, convert its (Image => Mode) to RGB color or to Grayscale so you can use the clone stamp.
  • If leveling is different, level the lighter version to match the darker version.
  • If one page is larger than the other, change the dimensions (Image => Image Size) so they match.
  • Using the clone stamp tool, on the decensored gallery, select an exact source point (alt-click)
  • Make a new empty layer on the censored gallery
  • On the censored gallery, at the same exact point, click to set the clone stamp's destination. Now you can "paint" areas of the decensored gallery onto the censored gallery
  • Paint over all censored areas with the clone stamp to copy the decensor. If you find that the colors don't match up exactly, which they often don't, use lower hardness so the decensored area blends in with the censored page.
  • Save the newly decensored page, close both Photoshop tabs
  • Repeat for all pages
Upload the new pages. You're done.
Manually, much of your time will be spent opening pages, setting them up, precisely lining up the clone stamp, and saving, and only a moderate fraction of time will be spent actually painting the decensor. What my script does is it automates everything in the page loop above except painting the decensor, which you still have to do manually. This means a lot more of your time will be spent productively, rather than on overhead.

(2) Example use of the script:
I was looking at the galleries and found a decensored one and decided to copy it to the Japanese version after making sure the pages [reasoningtheory.net] matched up.

After downloading the archives, I put them in separate directories and renamed the files so they would come up in order in Windows Explorer. (this is essential so that pressing the down arrow selects the next image in the sequence for each folder - I recommend Bulk Rename Utility). I make another directory for the finished images and copy into it the first few images (with no censorship) from the censored gallery. Select [reasoningtheory.net] the first censored page in each folder and open Photoshop. (everything up to here are the obvious steps any editor would make regardless) Now the magic happens. In Photoshop, I press the hotkey for AHK.

Here's the video: [reasoningtheory.net] https://reasoningtheory.net/decensoring/decensoring.webm (This is in real time, it's not sped up)

I first tell the script the target (censored) directory by activating that window, and then I tell the script the source (uncensored) directory. Then, it opens the current selected page in each folder, makes a new layer, gets the clone stamp source from the uncensored page, pastes it onto the censored page, and undos (this way the stamp gets lined up without anything new being painted). All the user has to do is paint the decensor - once that's done, it'll save to the finished folder. The script takes care of everything but the actual painting - this lets me finish each page in a matter of seconds rather than a minute or more. Now I have a new decensored gallery done in a small fraction of the time it would have taken otherwise!

The result: [English decensored] + [Japanese censored] = [Japanese decensored]

(3) Details / Howto:
Installation details:
The AutoHotkey software is able to send keystrokes, mouse clicks, and so on to Windows programs; my script takes care of the tedious repetitive tasks involved in opening and setting up each page. Install [autohotkey.com] Autohotkey 1.1, then download my script [reasoningtheory.net] Decensoring.ahk (you can view the code text) and double click it. An icon will appear in your taskbar: this means the script is ready for you to press the hotkey while in Photoshop. Optional: If you want to be able to automatically level one or both of the pages, [creativemarket.com] install the Photoshop Action Set [reasoningtheory.net] Decensoring.atn (it's just that one leveling action)

Usage details:
Before activating the hotkey in photoshop, check the true/false settings at the top of the script (right click the icon and Edit).
Set targetIndexed to True if the target (censored) gallery's images need to be converted from indexed color (so you can use Clone Stamp). Same for sourceIndexed (for the uncensored gallery's images). Set levelTarget to true if you need to level the target (censored) gallery before pasting on the decensor so contrast matches; same for levelSource Adjust the leveling amount through the Photoshop Actions pane.

The script will automatically detect image dimensions and downscale the larger image if necessary. If you want to upscale the smaller image instead, set doUpscale to true.

If you change any of the settings, you need to Reload the script before the changes take effect (right click the icon, Reload).
After you open Photoshop, you might open a random image and then close it, just so photoshop loads all its resources into memory. The script is designed to run fast, so delays of a fraction of a second can create problems.

Adobe Photoshop should be at the top of your "Open With" list when right clicking on an image file: if it isn't, you'll have to add an extra "send {down}" or few to the script to simulate down-arrow key presses.

With Photoshop active, press capslock and then G to activate the script. It will prompt you for the folder you're copying onto (the censored gallery). Alt-tab to that folder and press capslock again. Then it'll prompt you for the folder you're copying from (the uncensored gallery). Alt-tab to that folder and press capslock. Now you can start for real: the script will open the first selected image in each folder and use the clone stamp to line up the decensored gallery with the censored one. (don't move the mouse while this is going on, or the stamp might end up out of alignment) Finish copying the decensor and press capslock twice to open the Save For Web dialog (you have to press Save manually the first time; make sure the directory and the save format are correct) and go on to the next page.

If you get interrupted, Reload the script, close Photoshop tabs, and you can start again from the currently selected page in the folders.

Once finished, or there's an issue and need to reset, right click the green AHK icon in the system tray and exit or Reload.

If your system is slow, the script's Sleep commands might be too short, and it might try to do too much in too short of a time, and mess up in Photoshop. You can either Reload and try again, or you can try to edit the script code and increase Sleep times, if you can identify where the problem is. (eg "Sleep 300" = script pauses for 0.3 seconds waiting for Photoshop to finish processing)

This script doesn't only allow for copying decensors quickly; you can do the reverse, for instance, and copy text bubbles from a censored version of a gallery onto a decensored version of a gallery, or from a non-colorized version to a colorized version. You could also use the script for removing scanmarks.


I would be more than happy if even one person started using this to spread decensored versions around more. Getting it set up and working may be a chore, but it's worth it if you want to upload decensors to help the community - if you have any problems I want to help fix them. Feel free to ask questions or for improvements or examples. (Currently it only supports copying a decensor into one language at a time, but that might change in the future)
User is online!Profile CardPM
Go to the top of the page
+Quote Post

 
post Apr 18 2017, 09:33
Post #2
lacus1



Casual Poster
***
Group: Members
Posts: 234
Joined: 10-September 15
Level 343 (Godslayer)


Nice work! (IMG:[invalid] style_emoticons/default/biggrin.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 18 2017, 11:10
Post #3
camaleon666



Lurker
Group: Lurkers
Posts: 2
Joined: 5-May 08
Level 17 (Novice)


If this works I'm gonna decensor the hell out of half the internet hentai mangas, I swear.
(IMG:[invalid] style_emoticons/default/laugh.gif) (IMG:[invalid] style_emoticons/default/laugh.gif) (IMG:[invalid] style_emoticons/default/laugh.gif) (IMG:[invalid] style_emoticons/default/laugh.gif) (IMG:[invalid] style_emoticons/default/laugh.gif) (IMG:[invalid] style_emoticons/default/laugh.gif) (IMG:[invalid] style_emoticons/default/laugh.gif)

EDIT: Nah. I already check and resolutions definitevlyy don't mach at all (IMG:[invalid] style_emoticons/default/sad.gif)

This post has been edited by camaleon666: Apr 18 2017, 11:12
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 18 2017, 17:16
Post #4
Princess_Sakura



💕ăƒȘăƒˆăƒ«ăƒ—ăƒȘăƒłă‚»ă‚č💕
********
Group: Members
Posts: 3,471
Joined: 22-March 09
Level 445 (Godslayer)


Awesome work.

Thx. (IMG:[invalid] style_emoticons/default/biggrin.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post May 2 2017, 19:36
Post #5
Red of EHCOVE



Viceroy of Oook & EHCOVE cofounder
**********
Group: Gold Star Club
Posts: 9,492
Joined: 28-April 07
Level 365 (Godslayer)


Bump cool idea
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 14 2017, 15:20
Post #6
aa66609



Lurker
Group: Lurkers
Posts: 1
Joined: 15-April 14


does this script only apply to decensors manga?
can i use this script to made multiple languages manga's qickly(censored manga) ?

This post has been edited by aa66609: Jun 14 2017, 16:01
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 14 2017, 20:07
Post #7
_Anzu_



Casual Poster
***
Group: Members
Posts: 172
Joined: 29-January 17
Level 169 (Lord)


QUOTE(aa66609 @ Jun 14 2017, 06:20) *

does this script only apply to decensors manga?

Decensored works* And yes.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 16 2017, 11:46
Post #8
Superlatanium



Dreaming of optimizing the system
*********
Group: Gold Star Club
Posts: 7,489
Joined: 27-November 13
Level 500 (Godslayer)


I made some improvements.

There is now a feature that allows you to save the decensored area you've painted, which can be used later for decensoring other translations of the same gallery completely automatically. After painting on the decensor, control-clicking the layer (or using "Select Layer 1 Area") will select all non-transparent pixels in the layer. [For the script to do this automatically, you need to install the (updated) [reasoningtheory.net] photoshop Action.] The script will save the selection as an alpha (transparency) channel in the folder of your choice. After saving the alpha channel, the script will continue on like normal, saving alpha channels at the end whenever the new layer isn't empty.

Once you're done with that gallery, you should have a batch of newly decensored pages as well as a folder full of Alpha information for each page, something like [reasoningtheory.net] this. Then, when working on the same gallery in other languages, all you need to do is to point the script at the Alpha folder, it'll load the selection, and then it'll Clone Stamp the entire (decensored) page onto the (censored) page's selected areas, saving/closing and repeating for each page, without any user input.

By default, the hotkeys are:
To copy a decensor while generating alpha files: Capslock-t (you'll be prompted for the source folder, the target folder, and the Alpha folder)
To use existing alpha files to copy a decensor: Capslock-u (you'll be prompted for the source folder, the target folder, and the Alpha folder)
To copy a decensor without saving or using any alpha files: Capslock-g (you'll be prompted for the source folder, the target folder)
To convert (level, etc) each page without doing anything else: Capslock-h (you'll be prompted for the source folder)

This method makes decensoring very long galleries (like tankoubons) a lot easier. For example, instead of going through 200 pages for each of 8 languages, you only need to go through 200 pages for one language, and the decensored pages for the other languages will be created automatically. (Make sure the filenames are identical; if an Alpha file is named "12.psd" then the censored page prefix also needs to be "12". eg. a filename of "12-hentairules.net" will not match, resulting in errors / skipped files)

Other notable fixes:
(1) Very important: At the top, please set "zoomx" and "zoomy" to the coordinates of your Zoom panel in photoshop. (IMG:[reasoningtheory.net] https://reasoningtheory.net/decensoring/zoom.png) Find the coordinates using Window Spy (right click the AHK tray icon, Window Spy, activate Photoshop, hover over the zoom panel, record the "In Active Window: ####, ####" coordinates) (I know it's a messy solution, sorry. Without this, the AHK script won't be able to find your zoom panel, and it'll break)
(2) Files and folders are now opened/detected directly, so no more tabbing between Windows Explorer and Photoshop windows, potentially fixing a problem and making the script a bit faster

The script is still available at the usual place:
[reasoningtheory.net] https://reasoningtheory.net/decensoring/Decensoring.ahk

Tell me if you run into any problems
QUOTE(aa66609 @ Jun 14 2017, 13:20) *
does this script only apply to decensors manga?
can i use this script to made multiple languages manga's qickly(censored manga) ?
See the webm for an example of what's going on: you need at least one uncensored gallery first.
User is online!Profile CardPM
Go to the top of the page
+Quote Post


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 


Lo-Fi Version Time is now: 28th March 2024 - 21:02