Jpeg 2k support in blitzmax?

BlitzMax Forums/BlitzMax Programming/Jpeg 2k support in blitzmax?

Anyone know if support for jpeg 2k is coming as it is very much superior to standard jpeg, ideal for games actually.

Even supports alpha channels and lossless modes.

That would be interesting to see if Mark would include it as an official module.

I do have c++ code for encoding and decoding JPG2000, the decoding stuff would be pretty simple to integrate into BMax. I'm not going to implement it though, not if it's going to be added by BRL at a later date.

Interestingly, the popcap framework supports it. It seems an ideal solution for online distributed games.

Gonna have to look this up now.

I believe you have to pay like $20,000 for a licence ?

Well the license I've got says that I can do anything I want with it.

It looks that like GIF and JPG before it, JPG2000 also has some company contesting it violates one of its patents... No final ruling yet, though.

GIF patent has passed, while JPG patent is still active thought ... (just no one payed the JPG "inventors" as they promoted it too long for free to make it acceptable to just change that after 10 years or even more)

(just no one payed the JPG "inventors" as they promoted it too long for free to make it acceptable to just change that after 10 years or even more)


Actually, the patent in question is NOT held by the JPG inventors -- it's a 3rd party who had a seeminly unrelated patent that could be argues applied to part of the algorithm, if you hold it 'just right' and look at it from the corner of your eyes.

The JPEG file format was created by the JPEG group (Joint Photographic Experts Group), which the intention of being a file format specifically aimed at photographic images, better than alternative formats at the time. It was intended to be completely free. It wasn't until much later that another company laid claim to some of the underwater work.

it has the exact same issues as normal jpeg, ie it's absolutely nothing to worry about. ALL technologies can be contested by sleeper companies with obscure patents. It's way nicer than normal jpg and perfect for smaller online games.

Someone should implement this : http://www.openjpeg.org/

I'm evaluating jasper today which is the only C reference implementation listed here:

http://www.jpeg.org/jpeg2000/j2kpart5.html

I only say there was a fee because in Graphic Converter on the Mac they implemented JPEG2000 and said they had to pay $20,000 for a lincence. Maybe it's a commercial license?

Hmm the tests i did once showed that it strongly depends on the material you're having.
While having less artifacts then jpg, it blurs a lot more.
Depends a lot on the picture and the compression level...for instance:


http://www.marune.de/taumel/test/max/_tmp/fral.jp2


Greetings,

taumel

It's undeniably better on every level. Gone are the 8x8 compression artifacts.

Don't forget it also allows alpha channel information to be embedded.

Having a alpha channel and a no lossy mode is a plus but from the picture quality it's not just better. It simply depends on the situation - look at the pictures i've posted...

To get the bmp (source) just use this link: http://www.marune.de/taumel/test/_max/tmp/fral.zip

Artifacts are reduced but please welcome sludgy areas.

I don't think I will get sludgy areas :) Thats only with extreme settings.

Even lossless, it is smaller than the smallest comparable PNG. That is very good news.
This is so utterely perfect for online-distributable games.

http://www.fnordware.com/j2k/jp2samples.html

See for yourself. Both 16k and the j2k version is noticably LESS sludgy :)

You can also get the j2k photoshop plugin from there.

Well, i made those pictures with a photoshop-plugin and if you are able to look at them then you will see that they show the effect i described. But maybe you don't see it as you can't watch jp2/j2k files?

Anyway also if you google around you will find enough picture comparisons where these effects are shown and discussed.

To say that jp2 is the cure for online games is total nonsense as most of the online games are flash games which use vector formats gfx out of the box and if you're talking about the second biggest platform shockwave than also here flash graphics are included (on the fly converted to textures if neede for 3d) or the most common img-fileformat jpg is used. And if using shockwave compression on pictures all so defined pictures are compressed to jpg no matter what they were before. Music is by far a much greater memory eater here as there only exists one mod-tracker xtra which has to be bought seperately and also downloaded beside of the plugin. Here you could spare much more memory.

I suggest you discuss that with successful people distributing shareware games for a living before telling me it's total nonsense. Furthermore can you tell me your contribution to this thread?

All you have done is put j2k down and put forwards reasons why you think it's no good.

How about trolling elsewhere?

I'm not trolling. jp2 just isn't the holy grail for everthing. It's good for this and bad for that, nothing more nothing less. If it's implemented into bmax hey that's good to hear but out of this there won't be a new age of online games...

As for professionlism i do earn my living a.o. with online games...

@Skid, I have the Jasper Implementation but it's supposed to be really slow compared to the one I posted. I also have the "C" code for OpenJPG and it works on Mac, Linux and OSX. You can get the source from thier site.

I'm not trolling. jp2 just isn't the holy grail for everthing. It's good for this and bad for that, nothing more nothing less. If it's implemented into bmax hey that's good to hear but out of this there won't be a new age of online games...


Agreed.

The more image formats readily supported the better of course -- but individual circumstances will always dictate what the best format to use will be.

But since sometimes every byte counts, new options are always appreciated.

Also agreed.

Do you know what a real revolution would be regarding gfx/sfx-size in online-content?

If there would be editors+mods+plugin for some modular generative concepts like there are in werkkzeug ( http://www.theprodukkt.com/werkkzeug1.html ) or will be in spore. Just take a look at kkrieger ( http://www.theprodukkt.com/kkrieger.html ). I think you won't be able providing such a game experience with only adding jp2 while staying below 100kb.


Greetings,

taumel

all you're doing is kissing up to yourselves: you're not CONTRIBUTING.

@Skid, Do you intend on integrating this? It would certainly be a big USP!

@One Eyed Jack:

Still whining?

I vote for JPEG2000 support. It's so much more important than 3d mod ;-)

Because of alfa channel I stucked with png format and my game is much bigger that I want it to be (17mb already).

PNG

Did you compress your PNG's with maximum compression?

AngelDaniel: I wasn't aware PNG's even had variable compression, given that it's lossless (unlike JPG, where you can adjust the quality/filesize)

It does indeed have variable compression (intended for filesize/decoding time tradeoff I suppose) which goes I think from 1 to 9. I know how to set the level with GIMP, not sure about any other programs.

Not like JPEG2000!

'cmon Skid! An official mod? or a chargeable user mod?

Just made a test:
PNG: 597 552
JP2: 597 893 (lossless)
JP2: 123 023 (75 compression factor)

And quality loss between lossless and 75 is marely noticable.

I vote again for official mode. I can even pay for it few bucks (that I will for sure save on bandwidth).

So when its ready? ;-)

I have similar results with lossless jpeg actually coming in less than the png. (png suitably crushed) - It depends on the image used. This means it will be pretty fantastic with a little lossy compression...

Drooling over the alpha lossy compressed j2k possibilities :)

I don't mean to be offensive ;-) Just want to ask if anyone is working on implementation of JPEG2000?

Unless someone can confirm OpenJpeg library works with 32 bit format (documents indicate only 8 and 24 bit) I'll be continuing work on a jasper based jpeg2k imageloader module.

Well, docs indicate:

JPEG 2000 encoder
Required arguments
Infile (format pnm, pgm, ppm, pgx or bmp): -i Infile.pgm

And on those sites they say that PNM is PPM + PAM.
http://netpbm.sourceforge.net/doc/pnm.html
http://netpbm.sourceforge.net/doc/pam.html

From PAMS description:

"Transparent

Each of the visual image formats mentioned above has a variation that contains transparency information. In that variation, the tuple type has "_ALPHA" added to it (e.g. "RGB_ALPHA") and one more plane. The highest numbered plane is the opacity plane (sometimes called an alpha plane or transparency plane).

In this kind of image, the color represented by a pixel is actually a combination of an explcitly specified foreground color and a background color to be identified later."

Hope that helps.

And just in case, documents indicate 8 or 24 bit for BMP format.

Again I don't want to be offensive ;-) Are you working on this Skid?

Any news on JPEG2000 support? I had talked to codeminion guys (www.codeminion.com) and it took them only 3 days to implement jp2k support based on jasper implementation.

Thanks for any informations.

I've been stuck in bug reports for too long, will dig out and upload work in progress tomorrow.

Great news. Thanks for the info.

windows users try:

syncmods -u username -p password axe.jasper

you may need to rebuild the module, there is an example with image you can test in mod/axe.mod/jasper.mod/testjasper.bmx that looks something like this:
' testjasper.bmx

Import axe.jasper

Graphics 1024,768
pic=LoadJpeg2000("fral.jp2")
Cls
DrawImage pic,0,0
Flip
WaitKey
End


Warning, it's very work in progress, won't handle incbin files, uses the file "temp.bmp" as an intermediate so only 3 channel (no alpha) jpeg 2000 files are supported. Once the decoding is streamed directly to pixmap will have alpha channel support and I would also expect some improvement in speed also.

Nice one!

The example works well here. :o)

Free jpeg2000 importer/exporter for Photoshop: http://www.fnordware.com/j2k/

Works for me as well :) Speed improvement is not so necessary, we may decompres jp2 to png during instalation ;-) (that's what codeminion guys do).

Works great, Skidracer, although the loadtime is a bit long. 1200 millisecs for me, vs normal JPG 80 millisecs.

That migth be fault of jasper library (it is very slow and not as efficient as commercial libs).

Oh ok... But doesent it have any benifits, compared to PNG, except using less discspace?

Nope. Use PNG damnit. It's definately a superior format with good compression and support for many bitdepths and alpha channel :)

What benefits would you expect? Using less disc space is very important in downloadable games. It will allow me to add 2 more minigames to Tom's Hen House within the same download size (or smaller) :)

the benefits of being able to use masking on image which is not possible when you leave loseless.

the benefits of being able to use masking on image which is not possible when you leave loseless.


True, but you can still mix & match: PNG with masking for your sprites, and JPG/JPG2000 for your background images.

jpg2000 supports masking

How stable is jpeg2k mod at the moment? I am planning to use it in my very soon coming release. When we can expect alpha channel support? (not offensive question).


Warning, it's very work in progress, won't handle incbin files, uses the file "temp.bmp" as an intermediate so only 3 channel (no alpha) jpeg 2000 files are supported. Once the decoding is streamed directly to pixmap will have alpha channel support and I would also expect some improvement in speed also.


I would use it for non-critical testing right now :)

BTW, fab work skid, nice one!

Here's latest version which supports reading from any BlitzMax TStream including incbin:: paths and decodes directly to PixMap which in release mode seems to be so so for speed.

If someone can post a 32 bit jp2 file I can test with I'll get that sorted and then turn it into a standard image loader.

overwrite jasper.bmx in axe.mod/jasper.mod with following:
see post below


http://www.redflame.net/files/mona.zip

4 images of the mona lisa zipped:

one with alpha channel information
one with 4 bit colour depth, and 64x64 tile size
one lossless but half the size
one compressed 'standard'

Thanks Rob.

.

MonaLisa files are corrupted (I can't open them with normal image processing software that supports jp2).

My test image with alpha (512x512x32)
www.anawiki.com/download/alpha.jp2
www.anawiki.com/download/alpha.png

Alpha channel doesn't work and colors are corrupted.

Well, images without alpha channel are corrupted too (colors looks like they misplaced RGB).

MonaLisa files are corrupted (I can't open them with normal image processing software that supports jp2).


I was able to open those Mona Lisa pics just fine in Photoshop with Fnordware's free JPG2000 plugin... http://www.fnordware.com/j2k/

Very weird though: I got the plugin to work and show me the fractal image. Then I changed the source to point to one of the mona lisa jp2's, but launching it kept showing me the fractal instead??

Made sure that I hadn't locked the code, and no quick build enabled. Weird.

(It does seem a bit unfortunate that the loader seems sluggish -- the same JP2 images load many times faster in photoshop than in blitzmax with the jasper plugin)

Made another test. Alpha doesnt work and image is probably RBG istead of RGB.

MonaLisa files are corrupted (I can't open them with normal image processing software that supports jp2).


That might actually be a problem your image processing program. I can't see a fault with fnordware + photoshop.

The speed also seems a bit worrying using Jasper - I wonder if it can be optimised?

I used PaintShopPro9 to open MonaLisa and to create my jp2 files.

Mona Lisa loads in BMX, but it has blue colors and as I see it in image viewer it is supposed to be in grey scale?

They show up in full-color in Photoshop to me...

What about BMX? Do MonaLisa or my test image show up in full color?

OK, new version should now support 4 channel jp2 files and 4 bit channels (yuck).

Please apply the following patch to libjasper/jpc/jpc_dec.c so code starting at line 1072 looks like this:
	/* Apply an inverse intercomponent transform if necessary. */
	switch (tile->cp->mctid) {
	case JPC_MCT_RCT:
		assert(dec->numcomps >= 3);
		jpc_irct(tile->tcomps[0].data, tile->tcomps[1].data,
		  tile->tcomps[2].data);
		break;
	case JPC_MCT_ICT:
		assert(dec->numcomps >= 3);
		jpc_iict(tile->tcomps[0].data, tile->tcomps[1].data,
		  tile->tcomps[2].data);
		break;
	}

and replace jasper.bmx with the following:
Rem
bbdoc: Jasper image loader
about:
The Jasper loader module provides the ability to load JPEG2000 format #brl.pixmap.pixmaps.
End Rem
Module axe.jasper

ModuleInfo "Version: 1.701"
ModuleInfo "Author:  D. Richard Hipp"
ModuleInfo "License: Public Domain"
ModuleInfo "Modserver: BRL"

Strict

Import BRL.Pixmap
Import BRL.EndianStream

Import BRL.Max2D
Import BRL.StandardIO
Import BRL.Retro

Import "libjasper\bmp\bmp_cod.c"
Import "libjasper\bmp\bmp_dec.c"
Import "libjasper\bmp\bmp_enc.c"
Import "libjasper\base\jas_cm.c"
Import "libjasper\base\jas_debug.c"
Import "libjasper\base\jas_getopt.c"
Import "libjasper\base\jas_icc.c"
Import "libjasper\base\jas_iccdata.c"
Import "libjasper\base\jas_image.c"
Import "libjasper\base\jas_init.c"
Import "libjasper\base\jas_malloc.c"
Import "libjasper\base\jas_seq.c"
Import "libjasper\base\jas_stream.c"
Import "libjasper\base\jas_string.c"
Import "libjasper\base\jas_tvp.c"
Import "libjasper\base\jas_version.c"
Import "libjasper\jp2\jp2_cod.c"
Import "libjasper\jp2\jp2_dec.c"
Import "libjasper\jp2\jp2_enc.c"
Import "libjasper\jpc\jpc_bs.c"
Import "libjasper\jpc\jpc_cs.c"
Import "libjasper\jpc\jpc_dec.c"
Import "libjasper\jpc\jpc_enc.c"
Import "libjasper\jpc\jpc_math.c"
Import "libjasper\jpc\jpc_mct.c"
Import "libjasper\jpc\jpc_mqcod.c"
Import "libjasper\jpc\jpc_mqdec.c"
Import "libjasper\jpc\jpc_mqenc.c"
Import "libjasper\jpc\jpc_qmfb.c"
Import "libjasper\jpc\jpc_t1cod.c"
Import "libjasper\jpc\jpc_t1dec.c"
Import "libjasper\jpc\jpc_t1enc.c"
Import "libjasper\jpc\jpc_t2cod.c"
Import "libjasper\jpc\jpc_t2dec.c"
Import "libjasper\jpc\jpc_t2enc.c"
Import "libjasper\jpc\jpc_tagtree.c"
Import "libjasper\jpc\jpc_tsfb.c"
Import "libjasper\jpc\jpc_util.c"
Import "libjasper\jpg\jpg_dummy.c"
Import "libjasper\jpg\jpg_val.c"
Import "libjasper\mif\mif_cod.c"
Import "libjasper\pgx\pgx_cod.c"
Import "libjasper\pgx\pgx_dec.c"
Import "libjasper\pgx\pgx_enc.c"
Import "libjasper\pnm\pnm_cod.c"
Import "libjasper\pnm\pnm_dec.c"
Import "libjasper\pnm\pnm_enc.c"
Import "libjasper\ras\ras_cod.c"
Import "libjasper\ras\ras_dec.c"
Import "libjasper\ras\ras_enc.c"

'Import "loadjpg2.c"

Const JAS_IMAGE_CT_UNKNOWN=$10000
Const JAS_IMAGE_CT_OPACITY=$8000

Const JAS_IMAGE_CT_RGB_R=0
Const JAS_IMAGE_CT_RGB_G=1
Const JAS_IMAGE_CT_RGB_B=2

Const JAS_IMAGE_CT_YCBCR_Y=0
Const JAS_IMAGE_CT_YCBCR_CB=1
Const JAS_IMAGE_CT_YCBCR_CR=2
Const JAS_IMAGE_CT_GRAY_Y=0

Const JAS_STREAM_READ=1
Const JAS_STREAM_WRITE=2
Const JAS_STREAM_APPEND=4
Const JAS_STREAM_BINARY=8
Const JAS_STREAM_CREATE=16


Const JAS_STREAM_UNBUF=0
Const JAS_STREAM_LINEBUF=1
Const JAS_STREAM_FULLBUF=2
Const JAS_STREAM_BUFMODEMASK=15

Const JAS_STREAM_FREEBUF=8
Const JAS_STREAM_RDBUF=16
Const JAS_STREAM_WRBUF=32

Const JAS_STREAM_EOF=1
Const JAS_STREAM_ERR=2
Const JAS_STREAM_RWLIMIT=4
Const JAS_STREAM_ERRMASK=JAS_STREAM_EOF|JAS_STREAM_ERR|JAS_STREAM_RWLIMIT

Const JAS_STREAM_BUFSIZE=8192
Const JAS_STREAM_PERMS=666

Const JAS_STREAM_MAXPUTBACK=16

Type jas_stream_ops_t
	Field read_(stream:TStream,buf:Byte Ptr,cnt) 'Int (*read_)(jas_stream_obj_t *obj, char *buf, Int cnt)
	Field write_(stream:TStream,buf:Byte Ptr,cnt) 'Int (*write_)(jas_stream_obj_t *obj, char *buf, Int cnt)
	Field seek_(stream:TStream,offset,origin) ' Long (*seek_)(jas_stream_obj_t *obj, Long offset, Int origin)
	Field close_(stream:TStream) 'Int (*close_)(jas_stream_obj_t *obj)
End Type

Type jas_stream_t
	Field openmode_
	Field bufmode_
	Field flags_
	Field bufbase_:Byte Ptr
	Field bufstart_:Byte Ptr
	Field bufsize_
	Field ptr_:Byte Ptr
	Field cnt_
	Field tinybuf_0
	Field tinybuf_1
	Field tinybuf_2
	Field tinybuf_3
	Field tinybuf_4					'uchar tinybuf_[JAS_STREAM_MAXPUTBACK + 1]
	Field ops_:Byte Ptr'jas_stream_ops_t
	Field obj_:TStream				'jas_stream_obj_t
	Field rwcnt_
	Field rwlimit_
End Type

Extern

Type jas_matrix_t
'	Field flags_	arrrrrghhh!
	Field xstart_
	Field ystart_
	Field xend_
	Field yend_
	Field numrows_
	Field numcols_
	Field rows_:Int Ptr Ptr
	Field maxrows_
	Field data:Byte Ptr
	Field datasize_
End Type

Type jas_image_cmpt_t
'	Field tlx_,			arrrgggh!
	Field tly_,hstep_,vstep_,width_,height_
	Field prec_,sgnd_
	Field stream_:Byte Ptr
	Field cps_
	Field type_
End Type

Type jas_image_t
'	Field tlx_,			//arrgh mark come here
	Field tly_,brx_,bry_
	Field numcmpts_
	Field maxcmpts_
	Field cmpts:jas_image_cmpt_t Ptr
	Field clrspc_			
	Field cmpref_:Byte Ptr
	Field inmem_
End Type

Function jas_init()
Function jas_setdbglevel(level)
Function jas_getdbglevel()

Function jas_stream_fopen(file$z,opts$z)
Function jas_stream_flush(handle)
Function jas_stream_close(stream:Byte Ptr)

Function jas_image_decode:jas_image_t(in:Byte Ptr,fmt,opts)
Function jas_image_encode(image:jas_image_t,out,fmt,opts)

Function jas_image_destroy(image:jas_image_t)
Function jas_image_clearfmts()

Function jas_image_strtofmt(fmt$z)

Function jas_matrix_create:jas_matrix_t(numrows,numcols)
Function jas_image_readcmpt(image:Byte Ptr,cmptno,x,y,width,height,matrix:Byte Ptr)
Function jas_matrix_getv(matrix,pos)

End Extern

Function ReadJStream(stream:TStream,buf:Byte Ptr,cnt)
	Return stream.Read(buf,cnt)
End Function

Function WriteJStream(stream:TStream,buf:Byte Ptr,cnt)
	Return stream.Write(buf,cnt)
End Function

Function SeekJStream(stream:TStream,offset,origin)
	Select origin
		Case 0 'SEEK_SET
			stream.Seek(offset)			
		Case 1 'SEEK_CUR
			stream.Seek(stream.Pos()+offset)
		Case 2 'SEEK_END
			stream.Seek(stream.Size()+offset)	
	End Select
	Return stream.Pos()
End Function

Function CloseJStream(stream:TStream)
	stream.Close()
End Function

Function JasperStream:jas_stream_t(stream:TStream)
	Local ops:jas_stream_ops_t
	Local jstream:jas_stream_t
	ops=New jas_stream_ops_t
	ops.read_=ReadJStream
	ops.write_=WriteJStream
	ops.seek_=SeekJStream
	ops.close_=CloseJStream
	jstream=New jas_stream_t
	jstream.rwlimit_=-1
	jstream.ops_=Byte Ptr(ops)
	jstream.obj_=stream
	jstream.bufbase_=Varptr jstream.tinybuf_0
	jstream.bufsize_=1
	jstream.bufstart_=jstream.bufbase_+JAS_STREAM_MAXPUTBACK
	jstream.ptr_=jstream.bufstart_
	jstream.cnt_=0
	jstream.bufmode_=JAS_STREAM_UNBUF
	Return jstream
End Function

Function ReadJasperStream:jas_stream_t(url:Object)
	Local stream:TStream
	Local jstream:jas_stream_t
	stream=ReadStream(url)
	If Not stream Return
	jstream=JasperStream(stream)
	jstream.openmode_=JAS_STREAM_READ|JAS_STREAM_BINARY
	Return jstream
End Function

Function LoadJpeg2000:TImage(fname$)
	Local	pixmap:TPixmap
	Local	streamin:jas_stream_t
	Local	in,out,image:jas_image_t	

	jas_init()
	jas_setdbglevel(0)

	streamin=ReadJasperStream(fname)
	If Not streamin RuntimeError "ReadJasperStream failed"
	
	image:jas_image_t=jas_image_decode(Byte Ptr(streamin),-1,0)
	jas_stream_close(streamin)

	If Not image RuntimeError "jas_image_decode failed"

	Local width,height,depth,pformat
	Local matrix:jas_matrix_t
	Local src:Int Ptr
	Local res,x,y,d,c
	Local line[]
	Local lshfts[],rshfts[],lshft,rshft
	
	depth=image.numcmpts_
	width=image.brx_
	height=image.bry_
	matrix=jas_matrix_create(1,width)
	src=matrix.rows_[0]
		
	line=New Int[width]
	pformat=PF_BGR888
	Select depth
		Case 1
			pformat=PF_I8
		Case 3
			pformat=PF_BGR888
		Case 4
			pformat=PF_BGRA8888
	End Select
	pixmap=TPixmap.Create( width,height,pformat )
	lshfts=New Int[depth]
	rshfts=New Int[depth]
	For d=0 Until depth
		Local cmpt:jas_image_cmpt_t
		cmpt=image.cmpts[d]
		Print cmpt.prec_+","+cmpt.sgnd_+","+cmpt.cps_+","+cmpt.type_		
		
		Local type_=cmpt.type_
		If type_=32768 type_=3
		lshft=type_*8
		rshft=cmpt.prec_-8
		If rshft<0 lshft:-rshft;rshft=0		
		lshfts[d]=lshft
		rshfts[d]=rshft
	Next	
	For y=0 Until height
		memset_ line,0,width*4
		For d=0 Until depth
			res=jas_image_readcmpt(image,d,0,y,width,1,matrix)
			lshft=lshfts[d]
			rshft=rshfts[d]
			For x=0 Until width
				c=src[x]
				line[x]:|((c Shr rshft) Shl lshft)
			Next
		Next
		ConvertPixels(line,PF_RGBA8888,pixmap.pixelptr(0,y),pixmap.format,width)
	Next
	jas_image_destroy(image)
	jas_image_clearfmts()
	Return LoadImage(pixmap)
End Function


Hi Skid, Emailed you regarding a patch which will boost the speed of jasper.

OK, Mona Lisa looks great. Colors and alpha are fine.

But what the hell is wrong with my image? Colors are fine, but there is no alpha. And it doesn't matter if I create jp2 (from PNG with alpha) with Photoshop or PaintShopPro. In both programs I can see alpha channel, but not in BMX.

???

Roman, not sure, it is definitely coming in as a 3 channel jp2, perhaps the extension is wrong and it's one of the more complex jpeg2000 file types with channels in alternative layers or something.

Rob, is it possible to create jp2 in alternative color space, cmyk etc?

I would also like some single channel test pics, alpha channel only and greyscale (intensity) if it's possible.

Skid: www.redflame.net/files/jp2.zip

mixture of stuff. One of the mono ones will probably have alpha... I think I stuffed the second. Some other assorted bit depth images too.

Let me know when you have them and if you need more.

cymk? I don't know. I think it is converted to rgb?

Can anyone give me some clues on how to create jp2 with alpha channel that can be read by BMX? Every test image that I or my friends made doesn't work. The only image that works is mona_alpha.jp2 :(

When you create the image in your package, create it as if you were doing a png with alpha. If this fails for you then it is the fault of the exporter you are using.

But we are using fnordware exporter for Photoshop :D and I don't see any options in this exporter to turn on or off alpha channel.

The alpha channel is supported by the exporter if it exists.

The correct way to do alpha in photoshop is to use layers - the checker pattern is your alpha channel information. The exporter will export it properly.

Would you mind posting a link to example PSD file with properly prepared alpha channel? I am not a PSD expert and I believe we do it correctly, but still without success :(

1) create a new psd file

2) make sure there are two layers in the file

3) the bottom layer lower down in the layers palette should be empty (checker pattern).

4) any layers above this contain your graphics

Try loading your jpeg2k files back into photoshop. You might be doing it right and this module might be doing it wrong.

Ok download this:

www.redflame.net/files/psdj2k.zip

It contains one psd file and one j2k file saved with 80% quality using nothing but default panel on fnordware. No advanced options were used at all.

Thanks for help.

It's odd for me, but no matter how we create jp2 file it is properly read and viewed by Photoshop or PaintShopPro, but not in BMX.

Here is my PSD and JP2 files:
www.anawiki.com/download/alpha.zip

It would be great if this module could read transparency info from files that I can manage to create ;-) ie.PaintShopPro files.

Perhaps simon hasn't finished it yet.

Totaly depresed I loaded your PSD file and exported it to jp2 and guess what? Alpha aint work :(

What version of PSD do you have? What fnordware plugin version do you use?

The beta fnordware j2k plugin. Perhaps that is your problem.

What are those numbers that mod print out to conslole?
Can we expect any improvemts in the nearest future?

PS. After installing beta j2k plugin my problems with alpha are gone :)

That's good to hear anawiki, and yes, new version soon...

ok.. now how about dtx compressed textures :)