gemot encubed  

Go Back   gemot encubed > Gemot > Technical Issues

Technical Issues For bug reports, problem solving, and help running Japanese software.

Reply
 
Thread Tools Display Modes
  #1  
Old 2009-09-30, 19:15
Charuru Charuru is offline
Regular
 
Join Date: Aug 2009
Posts: 33
Default Tsukihime images

Does anyone know a way to extract the tsukihime sprites while keeping transparency?

sardec extracts as jpg, and afaik that loses the transparency.

Anyone know if there's a way? If there is none, that's ok too though...
Reply With Quote
  #2  
Old 2009-09-30, 20:15
Message's Avatar
Message Message is offline
Obsessive
 
Join Date: Dec 2003
Location: Netherlands
Posts: 323
Default

Sardec extracts files, not images. Tsukihime uses jpg images, so that's what comes out. If you open one of those in an image editor, you'll see they contain both the image and its transparency mask.
Reply With Quote
  #3  
Old 2009-09-30, 21:32
Charuru Charuru is offline
Regular
 
Join Date: Aug 2009
Posts: 33
Default

Thanks Message. What image editor do you use that allows you to see the transparency? In Photoshop I see a white, not transparent background.
Reply With Quote
  #4  
Old 2009-09-30, 23:11
dsp2003
Guest
 
Posts: n/a
Default

Charuru, the thing is... mask is stored in the same color space as original image. So, in order to get alpha-channeled pic, you'll have to cut the right part of image and convert it into mask. Yet, you can't save it as JPEG anymore, since it will degrade image quality and you'll lose transparency.

But, there's an easier way. I've added option of masked images handling in my own tool. See the signature for details.
Reply With Quote
  #5  
Old 2009-10-01, 09:26
Charuru Charuru is offline
Regular
 
Join Date: Aug 2009
Posts: 33
Default

Wow, great tool. I've opened up a jpg but am not sure how to save with transparency.

I see an option that says load alpha from supplied bmp file. Does that mean I have to create the bmp myself (by cropping)?

I see a bunch of options under setup, but I wasn't able to find a way to save correctly just by mucking around. Instructions would be great, thanks!
Reply With Quote
  #6  
Old 2009-10-01, 11:17
dsp2003
Guest
 
Posts: n/a
Default

Okay, let's give it a try:

0. Open, for example, ark_t01.jpg
1. Look for arrowbutton with double-colored "a" and pink minus. If you'll hold mouse cursor on it, the hint will pop up, it states "Extract SUBalpha into alpha space".
2. Click on the arrow
3. Select "Right" option, because your image have mask on the right side
4. You'll now have image with inverted alpha. If you'll spawn the preview window, you'll see "cutted out" sprite with white surface.
5. Now, press "Negative alpha image". Check preview again.
6. You now can select "BMP", "TGA" or "PNG" for saving with alpha channel (some software, including system build-in viewers and editors, cannot recognise 32-bit Bitmap files, so i highly recommend "TGA" or "PNG").
7. Enjoy. :)

Note: because the tool isn't stable yet and requires some code rewrite, there's no thing like batch alphas conversions yet - you'll have to do all files manually.

Last edited by dsp2003; 2009-10-01 at 11:20.
Reply With Quote
  #7  
Old 2009-10-01, 11:50
Charuru Charuru is offline
Regular
 
Join Date: Aug 2009
Posts: 33
Default

Thank you so much. :)
Reply With Quote
  #8  
Old 2009-10-02, 13:07
Enerccio's Avatar
Enerccio Enerccio is offline
Obsessive
 
Join Date: Apr 2007
Posts: 302
Default

I have a python script which do the same thing, though you need python and some pyimage or whatever, it can do a batch (thx Pytom!):

Code:
import Image
import ImageChops
import os
import os.path

def do(fn, newfn):
    im = Image.open(fn)
    width, height = im.size
    left = im.crop((0, 0, width / 2, height))
    right = im.crop((width / 2, 0, width, height))

    if left.size != right.size:
        return

    left.putalpha(ImageChops.invert(right.convert("L")))
    left.save(newfn)

for dir, dirs, files in os.walk('.'):

    for fn in files:
        print dir + "/" + fn

        if not fn.endswith(".bmp"):
            continue

        do(dir + "/" + fn, dir + "/" + fn.replace(".bmp", ".png"))
    
# do("re_defa1.bmp")
it might not work for jpgs, without a little rewrite, though
__________________
Reply With Quote
  #9  
Old 2009-10-02, 13:57
Charuru Charuru is offline
Regular
 
Join Date: Aug 2009
Posts: 33
Default

@Enerccio, thanks.

Would be awesome, but how do you use this? Do you need image.py in the same folder as the script?

Is running setup.py sufficient to install pyimage?

What I did:
Took the script, changed bmp to jpg. Saved it as a .py file in the same folder as the tsuki images. Ran it. The cmd screen came up and disappears, but nothing happens. I didn't get an error message either.
Reply With Quote
  #10  
Old 2009-10-03, 03:35
Enerccio's Avatar
Enerccio Enerccio is offline
Obsessive
 
Join Date: Apr 2007
Posts: 302
Default

weird, you should have an error if nothing happened
can you run it from command line?
__________________
Reply With Quote
  #11  
Old 2009-10-03, 09:31
Roto
Guest
 
Posts: n/a
Default

I don't think Windows will work with paths that are joined with / instead of \. This is why you use os.path.join instead of just concatenating strings together with slashes. (os.path is imported, but never used?)

Try replacing the second to last line with the following:

Code:
do( os.path.join(dir, fn), os.path.join(dir, fn.replace(".jpg", ".png")) )
It's also a good idea to actually open up a command prompt (start->run->"cmd"), navigate to the directory where the script and files are, and invoke the script from the command line, as Enerccio suggests. That way, if it displays an error, you'll be able to read it without the window disappearing.
Reply With Quote
  #12  
Old 2009-10-03, 10:52
Enerccio's Avatar
Enerccio Enerccio is offline
Obsessive
 
Join Date: Apr 2007
Posts: 302
Default

Roto: Hmm I am unsure, / does work in windows, the script works under windows for higurashi/umineko images (which is why I got it).
__________________
Reply With Quote
  #13  
Old 2009-10-03, 23:03
Charuru Charuru is offline
Regular
 
Join Date: Aug 2009
Posts: 33
Default

OK, having a lot of trouble trying to install pyimage.

Anyone know what this is?

C:\Users\user\Desktop\pyimage-0.8.13\pyimage-0.8.13>python setup.py install
running install
running build
running build_py
running build_ext
building '_image' extension
creating build\temp.win32-2.6
creating build\temp.win32-2.6\Release
creating build\temp.win32-2.6\Release\src
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox
/MD /W3 /GS- /DNDEBUG -Isrc -IC:\Python26\include -IC:\Python26\PC /Tcsrc/_image
module.c /Fobuild\temp.win32-2.6\Release\src/_imagemodule.obj
_imagemodule.c
src/_imagemodule.c(124) : error C2099: initializer is not a constant
src/_imagemodule.c(127) : error C2099: initializer is not a constant
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.ex
e"' failed with exit status 2
Reply With Quote
  #14  
Old 2009-10-04, 01:21
Enerccio's Avatar
Enerccio Enerccio is offline
Obsessive
 
Join Date: Apr 2007
Posts: 302
Default

isnt better to download installer?
__________________
Reply With Quote
  #15  
Old 2009-10-04, 02:08
dsp2003
Guest
 
Posts: n/a
Default

Charuru, while you're trying to make python scripts work, here's several small hints which reduces amount of manual operations:

1. Goto "Setup" section of Image Tool and enable "Handle SUBalpha as inverted image".
2. In Image Tool, press the "Extract SUBalpha" button instead of it's arrow, since it uses "crop from the right side" by default. ^^'
3. You can drag-n-drop file onto the form in order to open it.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I Want to Extract the Images Unregistered Technical Issues 2 2011-03-11 22:45
Shredded images... andoru Production & Help 7 2011-03-01 03:21
Working with Images in .wip Format Madame_Yes Production & Help 8 2010-07-17 05:50
Tsukihime on PSP Atvaark Technical Issues 0 2007-04-17 23:11
Tsukihime! procyon General Discussion 19 2006-04-19 20:08


All times are GMT -8. The time now is 17:06.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2022, vBulletin Solutions, Inc.