It is currently Tue, 25-07-17, 16:33 GMT

All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: trouble with png2bin
PostPosted: Thu, 30-08-12, 22:17 GMT 
Offline
User avatar

Joined: Fri, 29-02-08, 17:58 GMT
Posts: 85
Hi, Fridger. I wanted to virtualtexturize the recently released ma of Rhea, and I am having problems with png2bin. I don't remember this happening before, and certainly I used your tools many times. But it's been a while, and perhaps it was in a different system, different OS, etc.

The problem is simply that png2bin < PIA14928.png > PIA14928.bin produces a 0 bytes output. Without the > redirection, of course, there is nothing on stdout.

PIA14928.png is just PIA14928.jpg as downloaded from the Photojornal, and converted to true color png with XnView. Of course, the same happens with any png image.

I'm running Windows 7 Home Premium 64bit.

Is it weird? Am I doing anything wrong?

Thanks,

Guillermo


Top
 Profile  
 
 Post subject:
PostPosted: Thu, 30-08-12, 22:24 GMT 
Offline
User avatar

Joined: Fri, 29-02-08, 17:58 GMT
Posts: 85
Hi again. I didn't have any raw file to try. But I just downloaded your 5400 world test image and tried tx2pow2, with the same null output. Something is not working, and there is no indication of what it could be. Let me know if you have an idea.

G

_________________
Guillermo Abramson
Bariloche, Argentina


Top
 Profile  
 
 Post subject: re
PostPosted: Fri, 31-08-12, 6:43 GMT 
Online
User avatar

Joined: Tue, 04-09-07, 21:55 GMT
Posts: 757
Location: N 42.38846 W 83.45456
not to knock Fridger's tools ( they are good)

but have you used something that is a bit more general purpose

Image magick or Gmic

IM can do a B&W *.gray ( aka raw black and white)
or a *.rgb ( raw red green blue image )
just rename it to .bin
Code:
convert PIA14928.png PIA14928.rgb

or
Gmic
output right to raw
example :
Code:
gmic PIA14928.png -type uchar -o PIA14928.raw


if and only if the input is a rgb 8bit png
the output is a 8 bit rgb raw ( .bin)


Top
 Profile  
 
 Post subject:
PostPosted: Fri, 31-08-12, 16:43 GMT 
Offline
User avatar

Joined: Fri, 29-02-08, 17:58 GMT
Posts: 85
Thanks, John. But also the other tools (tx2pow2 as I mentioned, for example) also do not work.

_________________
Guillermo Abramson
Bariloche, Argentina


Top
 Profile  
 
 Post subject:
PostPosted: Fri, 31-08-12, 17:24 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4467
Location: Hamburg, Germany
Hi friends,

I just returned this morning from our annual hiking in the high mountains of Switzerland (Engadin!). Since the graphics card of my laptop presumably died to some extent en route, I was also rather hampered with responding to mails while travelling.

@Guillermo: indeed I am also puzzled by your reported problems with my tools, since I have tested them in so many environments. And others have, too. Be assured, I am now starting to investigate ;-)

One immediate remark is that the PNG color storage mode needs to be interleaved: i.e. RGB(A)RGB(A)RGB(A)RGB(A) ... In general there are other possibilities.

@John
One of the reasons for writing my tools was the bad and unreliable performance of ImageMagick's convert! So now you are recommending this one again ;-) . Convert is quite handy for smaller sizes but absolutely unsuited for monster images as we are interested in.

Stay tuned!

Fridger

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri, 31-08-12, 17:46 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4467
Location: Hamburg, Germany
OK here is a first test under LINUX. Win7 (64 bit) will follow very soon.

I downloaded PIA14928.jpg from the NASA site and converted it to PIA14928.png in RGB format with GIMP. Next I did

png2bin < PIA14928.png > PIA14928.bin

which gave a sensible, non-vanishing output. Next I did

tx2pow2 3 11520 < PIA14928.bin | bin2png 3 8192 > PIA14928pow2.png

which gave a perfect, new PNG image of size 8192x4096.

Hence under Linux, everything seems fine here. At least, there is no bug in the C++ code, as it seems.

With Win 7/64 bit a few further considerations might be relevant....

Fridger


Last edited by t00fri on Fri, 31-08-12, 20:34 GMT, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri, 31-08-12, 20:05 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4467
Location: Hamburg, Germany
Guillermo,

now I have completed the entirely analogous test of my tools (version 2.0pre2) for win7 / 64bit.
They were compiled as 32 bit apps. I used the included setup executable to install the tools properly!
After installation, you best log off and in again, to make the tools known in all dirs.

In my case, all tests work as successfully as under Linux!

So I am happy that I could not find a bug. But unfortunately, I can't tell you off-hand what went wrong in your case. For that I'd need to know further details.

One place where easily something might have gone wrong, concerns the used PNG libs. My tests and the code referred to the included libpng13.dll. Any newer version might require slight but essential adaptations in the code ... In case you have another libpng installed in your system, you should make sure that the included one is actually linked to by png2bin etc!!

Another possible cause: The win binaries of the last public distribution 2.0pre1 were presumably compiled with an earlier MS compiler (VS 2003 ?) which needs the
MSVCP71.dll runtime module that does not exist in my win7 / 64bit distro. So possibly you just need to recompile the tools with your resident compiler.


Fridger


Last edited by t00fri on Sat, 01-09-12, 16:04 GMT, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri, 31-08-12, 21:02 GMT 
Offline
User avatar

Joined: Fri, 29-02-08, 17:58 GMT
Posts: 85
Thanks, Fridger. I am using 2.0pre1, which is the one linked at the top of this forum. I installed them with the installer, as you suggest.

Regarding png libs, I don't know. In my second post I mentioned that also other tools gave null output.

I will try to compile the tools and check.

Regards,

Guillermo

_________________
Guillermo Abramson
Bariloche, Argentina


Top
 Profile  
 
 Post subject:
PostPosted: Fri, 31-08-12, 21:12 GMT 
Offline
User avatar

Joined: Fri, 29-02-08, 17:58 GMT
Posts: 85
OK, that worked! I compiled png2bin and it worked as expected. Will do the rest now.

It seems that there is some incompatibility. If I find out something, I will report here.

G

_________________
Guillermo Abramson
Bariloche, Argentina


Top
 Profile  
 
 Post subject:
PostPosted: Fri, 31-08-12, 21:32 GMT 
Offline
User avatar

Joined: Fri, 29-02-08, 17:58 GMT
Posts: 85
All tools compiled and worked as expected. Thanks for the suggestion.
(I am using VC++ 2008 Express).
G


Top
 Profile  
 
 Post subject:
PostPosted: Fri, 31-08-12, 21:58 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4467
Location: Hamburg, Germany
abramson wrote:
All tools compiled and worked as expected. Thanks for the suggestion.
(I am using VC++ 2008 Express).
G


Happy to read this!

Well I do tend to forget how long the texture tools already exist (5 years) and thus that it might be getting time for little updates here and there ...

Actually, the difference between 2.0pre1 and 2.0pre2 is very minor. Just the CUDA stuff for fast DXT generation has been a little upgraded. No bug fixes whatsoever were required.

Fridger


Top
 Profile  
 
 Post subject: re
PostPosted: Sat, 01-09-12, 1:33 GMT 
Online
User avatar

Joined: Tue, 04-09-07, 21:55 GMT
Posts: 757
Location: N 42.38846 W 83.45456
Quote:
I wanted to virtualtexturize the recently released ma of Rhea,


this was why i brought it up
it was not a monster 64 k or 128 k image

_________________
"I don't pitch Linux to my friends, I let Microsoft do that for me."
Using OpenSUSE 42.1 & Scientific Linux 6.7


Top
 Profile  
 
 Post subject:
PostPosted: Sat, 01-09-12, 1:45 GMT 
Offline
User avatar

Joined: Fri, 29-02-08, 17:58 GMT
Posts: 85
Indeed, making MSVCP71.dll available at run-time (I downloaded it from the web, not a very good idea, I know...), made all the tools (as installed from your distribution) work properly. You may wish to add it in the installer. I have not checked if they are redistibutable.

From what I have read on the web, it's a common compatibility issue. A related library is MSVCR71.dll.

Regards,

Guillermo

PS: the new Rhea map is much uglier than the Ciclops one from 2008. so I am not replacing it in the end... The Mimas one is fine though, even if it has very minor improvements.


Top
 Profile  
 
 Post subject: Re: re
PostPosted: Sat, 01-09-12, 16:11 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4467
Location: Hamburg, Germany
John Van Vliet wrote:
Quote:
I wanted to virtualtexturize the recently released ma of Rhea,


this was why i brought it up
it was not a monster 64 k or 128 k image


Certainly,...

But at least when I tested convert last, I spotted a number of bugs that also tend to have implications on small files ;-). I wrote mails to the author with comparatively little impact as to improved reliability...

Fridger


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group