READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

Noesis fmtWriteRGBA method

Read or post any tutorial related to file format analysis for modding purposes.
Post Reply
Eldinen
n00b
Posts: 12
Joined: Mon Nov 09, 2009 7:26 pm
Been thanked: 4 times

Noesis fmtWriteRGBA method

Post by Eldinen » Tue Apr 25, 2017 10:13 am

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?

Eldinen
n00b
Posts: 12
Joined: Mon Nov 09, 2009 7:26 pm
Been thanked: 4 times

Re: Noesis fmtWriteRGBA method

Post by Eldinen » Tue Apr 25, 2017 2:12 pm

Got it

Code: Select all

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

Post Reply