how do you scan to transparency?

1,673 views
Skip to first unread message

Trevor Boyd Smith

unread,
Apr 29, 2016, 9:35:23 AM4/29/16
to OpenToonz Users Forum
I am doing a bunch of linedrawings on N pages of paper. I would like to scan them in and have them converted to antialiased raster lines with the white becoming transparent. 

- I know how to do batch scans to PNG with the correct RETA filename format. But this only gets me the original image... without transparency.
- I know how to use things like GIMP (Gnu Image Manipulation Program) to convert a single scanned image with black lines and white background into black lines and a transparent background. But this takes at least a minute per image (maybe faster but probably not)... so 60 frames would take a long long time to convert all the white backgrounds to transparent.

Does GTS do batch scanning and convert white to transparent?

Or do I need to batch scan and then use OpenToonz somehow to convert all the frames to transparency?

I could write a python script that would iterate over all the files then for each file iterate over all the pixels and do a select by color and convert to transparency and then write to file... but this I would prefer if there is a way with GTS or OpenToonz.

Steven Robey

unread,
Apr 29, 2016, 11:22:26 AM4/29/16
to OpenToonz Users Forum
Might want to check out imagemagick. It is a command line tool for batch image editing. The program seem complicated but if watch some of the tutorials on youtube, you can get the job done.

Neroli Wesley

unread,
May 2, 2016, 9:03:43 AM5/2/16
to OpenToonz Users Forum
I think GTS will 'convert white to transparent' in that it traces colour, ie you choose up to six colours to trace. I haven't tried that aspect of the program but there are certainly controls for this. You can draw in colour, define the colour and then pinch the trace down to different sensitivity. It looks quite powerful. 

I've done a basic tutorial that would get you started but you would need to play with the trace settings yourself. https://www.youtube.com/watch?v=M0LHa3egIR8

However it's probably worth it because you can set up 'Levels' that include all the drawings for, I think, a particular character or element which you then lay into OpenToonz. 

I'd be interested to know how you go.

Trevor Boyd Smith

unread,
May 3, 2016, 9:50:36 PM5/3/16
to OpenToonz Users Forum
hey Neroli,

Your youtube video is quite amazing IMO (very good given that the video is only a slideshow made in a very short amount of time).

Unfortunately when I tried to scan an image I got an error message "Scan Critical Error".

I tried to trace the cause of the error by downloading the source but unfortunately the source code didn't have a Visual Studio solution (file with extension *.sln) and so I didn't get very far in figuring out what the error was caused by.

---

in my case I have a Brother scanner (model: ADS-1500w). 

not sure why GTS error'd out.

-Trevor

-Trevor

Trevor Boyd Smith

unread,
May 4, 2016, 11:12:51 AM5/4/16
to OpenToonz Users Forum
if i can't get GTS to scan, then maybe my new workflow would be:
- use different scanning software to get N images
- process N images with GTS
- load into opentoonz

so instead of two steps it would be three steps. but total time would be similar.

-T

Trevor Boyd Smith

unread,
May 4, 2016, 10:04:05 PM5/4/16
to OpenToonz Users Forum
FYI i did notice that your computer in the video is windows 7. my computer and the other guy you linked to in the forum were running windows 10. not sure if that is the issue but it's different. 

also the japanese GTS webpage readme does say it's only been tried on windows 7.

Trevor Boyd Smith

unread,
May 8, 2016, 5:04:55 PM5/8/16
to OpenToonz Users Forum
hey o,

made some good progress. check out the progress. each image shows progress. the final image is the current progress.

---

soo i've been all over the place in terms of trying different things. i tried irfanview but it didn't pan out. i heard about imagemagick in the news the other day because of some "critical security flaw" and so that reminded me that I didn't try imagemagick. I did a quick google and found imagemagick to be a robust opensource tool. I am a huge fan of all opensource tools (part of the reason why I am using opentoonz). I do lots of software and I can tell imagemagick is very high quality and very established and very featurefull. Given the google searches I did, I am very confident that imagemagick can do what I want. But I don't know how to use imagemagick enough to do what I want.

the first example picture is done with imagemagick:
- convert x.png -transparent white y1.png
- then adding y1 on top of the background

the second example is:
- create y2 with gimp (selection by color, delete, select all, copy+paste onto background)
- then add y2 on top of the background

but the problem is y1 and y2 aren't scanned images. so i decided to work with actual scanned images instead of something I drew on the computer. so y3 uses a scanned image. i drew something things with a HB and 8B pencil on white paper then scanned in the image.

the third example is:
- scan the image
- open gimp
- open the scanned grayscale image
- copy the grayscale to an alpha mask
- create a new layer of all black
- export the image as PNG y3.png
- add the background+y3.png and that is what I have

in the long term I will try to recreate this third example with imagemagick command line examples. then I will have a shell script or python script that applies the same procedure to all my scanned images.
background+y1.png
background+y2.png
background+y3.png

Trevor Boyd Smith

unread,
May 8, 2016, 5:06:47 PM5/8/16
to OpenToonz Users Forum
FYI i used two pencils for this drawing:
8B (darker)
HB (lighter)
Reply all
Reply to author
Forward
0 new messages