Page 1 of 1

Noesis fmtWriteRGBA method

Posted: Tue Apr 25, 2017 10:13 am
by Eldinen
I am trying to generate a file with Noesis from a PNG file.

So, I load a PNG file with Noesis, and I try to export it to my own format
The next code is launched.

Code: Select all

def fmtWriteRGBA(data, width, height, bsOut):
	datasize = len(data)
	print(datasize)
	image = rapi.imageEncodeRaw(data, width, height, "r8g8b8a8")
	datasize = len(image)
	print(datasize)
	bsOut = NoeBitStream(image)
	return 1
My doubt is, datasize is not null, but when I do
bsOut = NoeBitStream(image) or bsOut = NoeBitStream(data)
noesis generates a 0bytes file with of course 0 len.

How can I export this PNG file?

Re: Noesis fmtWriteRGBA method

Posted: Tue Apr 25, 2017 2:12 pm
by Eldinen
Got it

Code: Select all

	
mipData = rapi.imageResample(data, width, height, width, height)
bsOut.writeBytes(mipData)
this write the previous png to bytearray file