Member Controls

How to... > CASThumbnail JPG with ALFA block, format?
CatOfEvilGeniusLink to postposted: Sun Jun 27, 2010 11:18 pm

Member since:
 2010-06-27
Posts:
 2

The thumbnail JPGs in CASThumbnail.package have an ALFA block in them.  I believe this is an opacity mask, yes?  What is its format?  I thought maybe simple run length encoding, but that doesn't seem to be it.

 

SimPE can export those thumbnails as regular JPGs with no alpha block, so it must have some code in it that can decode and process ALFA blocks.

 

I want to be able to *import* JPGs (or some other, simpler image format) and make valid CAS thumbnails, with proper ALFA blocks, so I need to know the format.

 

This is for toddler separates.  The game seems unable to create proper thumbnails for them.  Won't show the mesh, nor the texture, just a naked toddler.  Even the CAS thumbnail camera was wrong, for the bottoms.  I could fix the camera, but not the actual thumbnail generation, so now I'm looking into replacing thumbnails in CASThumbnail.package.

 

pljonesLink to postposted: Wed Jun 30, 2010 8:53 pm
Avator for pljones

Member since:
 2005-04-02
From:
 London, UK
Posts:
 609

As far as I know, the JPEG format does not support an alpha channel.  PNG does, as does DDS.  Not being a modder, I've no idea how to get SimPE to do this, though, I'm afraid.

CatOfEvilGeniusLink to postposted: Thu Jul 01, 2010 9:20 am

Member since:
 2010-06-27
Posts:
 2

I understand jpg's cannot have an alpha channel.  However, they can have multiple segments, or blocks, that are not necessarily image data.  For example, the EXIF block, or a jpg thumbnail data (not the same as a CAS thumbnail).  What the hex editor in SimPE shows me is that the CAS Thumbnail jpg images have a block labeled "ALFA" and it appears to be some sort of compression of 0 and 255 values.  I think it must be an opacity mask (or alpha mask) because the game displays CAS thumbnails with a green smudge background that is not present in the images themselves.  I just can't figure out what compression algorithm was used on the "ALFA" data.  I thought perhaps if SimPE processed this data, you might know the algorithm.  After more research, I suspect SimPE either uses some system library to handle jpg's or it simply ignores jpg blocks that it does not understand. Ignoring unknown jpg blocks is quite common.

 

So as you said, I need to find me a jpg expert.  Regardless, thanks for taking the time to reply, much appreciated.



viewthread, 0, 0, CASThumbnail-JPG-with-ALFA-block-format