JCC not working (empty images)
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
- jack_norton
- Lemma-Class Veteran
- Posts: 4096
- Joined: Mon Jul 21, 2008 5:41 pm
- Completed: Too many! See my homepage
- Projects: A lot! See www.winterwolves.com
- Tumblr: winterwolvesgames
- Contact:
JCC not working (empty images)
Today decided to try JCC, ran it and generated all the jpg images. However when I try to run the game, all converted images are empty (not displayed in the game). I don't know why this happen, any clues? the jcc.rpy file obviously is there, and the files as well.
- PyTom
- Ren'Py Creator
- Posts: 16122
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: JCC not working (empty images)
hm... can you attach a couple of the generated images? Specifically, the original png and the .mask.jpg and .base.jpg files generated for it? That will help me determine which step is going wrong.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
- jack_norton
- Lemma-Class Veteran
- Posts: 4096
- Joined: Mon Jul 21, 2008 5:41 pm
- Completed: Too many! See my homepage
- Projects: A lot! See www.winterwolves.com
- Tumblr: winterwolvesgames
- Contact:
Re: JCC not working (empty images)
Well for now I just used 256 color png. For manga style art is more than enough (you don't even notice the difference) and also the size is even smaller than using JCC
Re: JCC not working (empty images)
Hmm. You quite possibly wouldn't notice the difference colour-wise, presuming you're talking about cel-shading, but... surely the difference is noticable in terms of transparency? Since 24bpp PNG and JCC can do varying levels of transparency, making the edges of the sprite smooth, while 8bpp (256-colour) PNG can only do on/off transparency and thus the edges will be abrupt and pixellated?jack_norton wrote:Well for now I just used 256 color png. For manga style art is more than enough (you don't even notice the difference)
Server error: user 'Jake' not found
- jack_norton
- Lemma-Class Veteran
- Posts: 4096
- Joined: Mon Jul 21, 2008 5:41 pm
- Completed: Too many! See my homepage
- Projects: A lot! See www.winterwolves.com
- Tumblr: winterwolvesgames
- Contact:
Re: JCC not working (empty images)
Well I am using 1024x768 as resolution, so is barely noticeable (at least for me). For now I'm going to leave it this way, can always change it later
- jack_norton
- Lemma-Class Veteran
- Posts: 4096
- Joined: Mon Jul 21, 2008 5:41 pm
- Completed: Too many! See my homepage
- Projects: A lot! See www.winterwolves.com
- Tumblr: winterwolvesgames
- Contact:
Re: JCC not working (empty images)
Ok I've found the time to upload the images. They look fine to me (mask is ok), still wonder why I get nothing displayed ??
- Attachments
-
- mask image
- window1.png.mask.jpg (3.22 KiB) Viewed 2767 times
-
- base image
- window1.png.base.jpg (18.84 KiB) Viewed 2766 times
- jack_norton
- Lemma-Class Veteran
- Posts: 4096
- Joined: Mon Jul 21, 2008 5:41 pm
- Completed: Too many! See my homepage
- Projects: A lot! See www.winterwolves.com
- Tumblr: winterwolvesgames
- Contact:
Re: JCC not working (empty images)
I even tried to load manually the files with:
image splash = im.AlphaMask(im.Image("gfx/logo.png.base.jpg", cache=False), im.Image("gfx/logo.png.mask.jpg", cache=False))
but still nothing is displayed. Nobody uses JCC ? I tried loading the images in my own C library and works, so must be a bug of renpy or SDL ?
image splash = im.AlphaMask(im.Image("gfx/logo.png.base.jpg", cache=False), im.Image("gfx/logo.png.mask.jpg", cache=False))
but still nothing is displayed. Nobody uses JCC ? I tried loading the images in my own C library and works, so must be a bug of renpy or SDL ?
- jack_norton
- Lemma-Class Veteran
- Posts: 4096
- Joined: Mon Jul 21, 2008 5:41 pm
- Completed: Too many! See my homepage
- Projects: A lot! See www.winterwolves.com
- Tumblr: winterwolvesgames
- Contact:
Re: JCC not working (empty images)
I think I found the bug in renpy:
the mask image is a grey JPG, so can't take the red channel I think... ?Function: im.AlphaMask (base, mask, **properties):
base and mask should be image manipulators. This function takes the red channel from mask, and applies it to the alpha channel of base to create a new image.
Re: JCC not working (empty images)
All pixels in a digital image are represented as red, green and blue values - even black and white. Typically, they'll range between 0 and 255, the maximum value you can store in a single byte.jack_norton wrote:the mask image is a grey JPG, so can't take the red channel I think... ?
Black is the absence of all colour, so it's RGB 0/0/0; White is all colour at the same time, so it's RGB 255/255/255. A 50% neutral grey is half-way between black and white, and as such it has an RGB value half-way between, of 128/128/128 (or 127/127/127, whichever you prefer).
So yes, a greyscale image still has a red channel, it's just that the red channel, the green channel and the blue channel will be the same. I expect that the reason the function uses the red channel in particular is just that it's convenient; as it goes, frequently the red value is stored in the lowest byte of a 4-byte integer for each pixel. For a greyscale mask image, you can read that sentence instead as "This function takes the luminance value from mask, and applies it to the alpha channel of base to create a new image."
Server error: user 'Jake' not found
- jack_norton
- Lemma-Class Veteran
- Posts: 4096
- Joined: Mon Jul 21, 2008 5:41 pm
- Completed: Too many! See my homepage
- Projects: A lot! See www.winterwolves.com
- Tumblr: winterwolvesgames
- Contact:
Re: JCC not working (empty images)
Ok, thanks for the explanation. Still it doesn't work does anybody uses JCC successfully?
- PyTom
- Ren'Py Creator
- Posts: 16122
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: JCC not working (empty images)
It worked when I tested it, a while ago. I'll debug it when I get back home, mondayish.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: JCC not working (empty images)
The yaruge hentai I released early this year successfully used jcc, and it's open-source in case you want to take a look (and please try to ignore the general pervertedness and crappiness of the work otherwise)jack_norton wrote:Ok, thanks for the explanation. Still it doesn't work does anybody uses JCC successfully?
Recently I'm just making graphics, so I haven't been fresh programming-wise for a while now (my mind goes blank on technical stuff nowadays).
What I do remember is make sure the png really needs the jcc functionality, i.e. it has transparency. Otherwise, in some instances, (and in virtually all cases where there is no transparency), a straight jpeg export is more efficient. In other instances, the deterioration of the jpeg mask is apparent.
What I did was compare pngs to jcc-induced jpegs and pick the ones with the best quality/size ratio. For images that have gradual gradients (such as, ahem, milky-white substances), you can't use jcc on the pngs without introducing pixelation around the edges, so you have to keep using pngs.
- jack_norton
- Lemma-Class Veteran
- Posts: 4096
- Joined: Mon Jul 21, 2008 5:41 pm
- Completed: Too many! See my homepage
- Projects: A lot! See www.winterwolves.com
- Tumblr: winterwolvesgames
- Contact:
Re: JCC not working (empty images)
Thanks, I'm going to check it. It uses an archive or I can extract 2 test images to check?
(even if as I said before is really strange, in my own C code the 2 jpeg made with JCC works fine! so I really don't understand the bug )
(even if as I said before is really strange, in my own C code the 2 jpeg made with JCC works fine! so I really don't understand the bug )
Re: JCC not working (empty images)
Try making a project with a minimal script to display just the JCC'ed image. If it still doesn't work in that minimum project, zip that up and post it. Also make note of what version of Ren'Py you are using.jack_norton wrote:Thanks, I'm going to check it. It uses an archive or I can extract 2 test images to check?
(even if as I said before is really strange, in my own C code the 2 jpeg made with JCC works fine! so I really don't understand the bug )
- jack_norton
- Lemma-Class Veteran
- Posts: 4096
- Joined: Mon Jul 21, 2008 5:41 pm
- Completed: Too many! See my homepage
- Projects: A lot! See www.winterwolves.com
- Tumblr: winterwolvesgames
- Contact:
Re: JCC not working (empty images)
Well actually the images I posted use a minimal script
I'm using latest renpy. I use that image to replace the default window/buttons background, but even if I try to show a simple image on startup, doesn't work
the logo images:
I'm using latest renpy. I use that image to replace the default window/buttons background, but even if I try to show a simple image on startup, doesn't work
Code: Select all
init:
# Declare images below this line, using the image statement.
image splash = im.AlphaMask(im.Image("gfx/logobase.jpg", cache=False), im.Image("gfx/logomask.jpg", cache=False)) #image splash = "gfx/logo.png"
label splashscreen:
$ renpy.pause(0)
scene black
show splash at truecenter
with dissolve
with Pause (1.0)
Who is online
Users browsing this forum: No registered users