POV-Ray : Newsgroups : povray.general : cannot open png file Server Time
26 Dec 2024 01:01:44 EST (-0500)
  cannot open png file (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: cpmac
Subject: cannot open png file
Date: 5 Apr 2006 06:25:01
Message: <web.44339a126679399260277a370@news.povray.org>
Hello
I'm trying to experiment with including bimaps.
I've used the following code but get the message
parse error cannot open png file.
The file renders correctly if I put a simple pigment instead of the texture.

What am I doing wrong?

#declare panel= prism {
    linear_sweep
    linear_spline
    0, // sweep the following shape from here ...
    0.01, // ... up through here
    4, // the number of points making up the shape ...
    <0,0>, <2,0>, <2,2>, <0,2>
     texture {
    pigment{ image_map { png "/noddy2.png" }
    }
 rotate<-90,0,0>
 translate<0,6,0>
 scale 0.5
  }


Post a reply to this message

From: Chris B
Subject: Re: cannot open png file
Date: 5 Apr 2006 06:38:12
Message: <44339e14$1@news.povray.org>
"cpmac" <web### [at] cpmaccom> wrote in message 
news:web.44339a126679399260277a370@news.povray.org...
> Hello
> I'm trying to experiment with including bimaps.
> I've used the following code but get the message
> parse error cannot open png file.
> The file renders correctly if I put a simple pigment instead of the 
> texture.
>
> What am I doing wrong?
>
> #declare panel= prism {
>    linear_sweep
>    linear_spline
>    0, // sweep the following shape from here ...
>    0.01, // ... up through here
>    4, // the number of points making up the shape ...
>    <0,0>, <2,0>, <2,2>, <0,2>
>     texture {
>    pigment{ image_map { png "/noddy2.png" }
>    }
> rotate<-90,0,0>
> translate<0,6,0>
> scale 0.5
>  }
>

I think the forward slash is the problem. I removed it and it parsed without 
error on Windows, finding a png file in the same directory as the pov file.
You're also missing a closing curly bracket on the pigment.

Regards,
Chris B.


Post a reply to this message

From: cpmac
Subject: Re: cannot open png file
Date: 5 Apr 2006 06:40:01
Message: <web.44339dd5f7526d8d94b2128b0@news.povray.org>
"cpmac" <web### [at] cpmaccom> wrote:
> Hello
> I'm trying to experiment with including bimaps.
> I've used the following code but get the message
> parse error cannot open png file.
> The file renders correctly if I put a simple pigment instead of the texture.
>
> What am I doing wrong?

I've partly resolved the problem. The slash before the file name shouldn't
be there.
But now I have no error message and see no panel. Just the floor and the
background.



> #declare panel= prism {
>     linear_sweep
>     linear_spline
>     0, // sweep the following shape from here ...
>     0.01, // ... up through here
>     4, // the number of points making up the shape ...
>     <0,0>, <2,0>, <2,2>, <0,2>
>      texture {
>     pigment{ image_map { png "/noddy2.png" }
>     }
>  rotate<-90,0,0>
>  translate<0,6,0>
>  scale 0.5
>   }


Post a reply to this message

From: Christoph Hormann
Subject: Re: cannot open png file
Date: 5 Apr 2006 06:45:03
Message: <e106ua$ngf$1@chho.imagico.de>
cpmac wrote:
> Hello
> I'm trying to experiment with including bimaps.
> I've used the following code but get the message
> parse error cannot open png file.

>     pigment{ image_map { png "/noddy2.png" }

Well - is there a file "/noddy2.png"?  That would be in your root 
directory which is - unlikely.

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.imagico.de/ (Last updated 14 Mar. 2006)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: cpmac
Subject: Re: cannot open png file
Date: 5 Apr 2006 07:40:01
Message: <web.4433ab68f7526d8de2f31a1f0@news.povray.org>
Christoph Hormann <chr### [at] gmxde> wrote:
> cpmac wrote:
> > Hello
> > I'm trying to experiment with including bimaps.
> > I've used the following code but get the message
> > parse error cannot open png file.
>
> >     pigment{ image_map { png "/noddy2.png" }
>
> Well - is there a file "/noddy2.png"?  That would be in your root
> directory which is - unlikely.
>
> Christoph
>
> --
> POV-Ray tutorials, include files, Landscape of the week:
> http://www.imagico.de/ (Last updated 14 Mar. 2006)
> MegaPOV with mechanics simulation: http://megapov.inetart.net/

I've corrected the slash (the png file is in the same directory as the pov
file)
I've corrected the curly bracket.


 #declare panel= prism {
    linear_sweep
    linear_spline
    0, // sweep the following shape from here ...
    0.01, // ... up through here
    4, // the number of points making up the shape ...
    <0,0>, <5,0>, <5,5>, <0,5>
     texture {
      pigment{
      image_map {png "noddy2.png"
        }
       }

      }
 rotate<-90,0,0>
 translate<0,6,0>
 scale 0.5
  }
The file parses with no error message but no visible result.
How is an image file supposed to adapt to it's suport. The image file has a
transparent part. Could it be that only the transparent part is on the
panel?

cpmac


Post a reply to this message

From: Trevor G Quayle
Subject: Re: cannot open png file
Date: 5 Apr 2006 09:35:00
Message: <web.4433c678f7526d8d6c4803960@news.povray.org>
"cpmac" <web### [at] cpmaccom> wrote:
>  #declare panel= prism {
>     linear_sweep
>     linear_spline
>     0, // sweep the following shape from here ...
>     0.01, // ... up through here
>     4, // the number of points making up the shape ...
>     <0,0>, <5,0>, <5,5>, <0,5>
>      texture {
>       pigment{
>       image_map {png "noddy2.png"
>         }
>        }
>
>       }
>  rotate<-90,0,0>
>  translate<0,6,0>
>  scale 0.5
>   }
> The file parses with no error message but no visible result.
> How is an image file supposed to adapt to it's suport. The image file has a
> transparent part. Could it be that only the transparent part is on the
> panel?
>
> cpmac

You should prisms are created as curves on the x-z plane and swept through
the y-axis.  On the other hand, image_maps are mapped on the x-y plane and
swept through the z-axis.  In order to get what I assume you are expecting,
you need to rotate the image_map to suit the prism face orientation.  Also
note that image_maps are mapped from <0,0> to <1,1> and repeated (unless
the once keyword is used) so if you want the image_map to fit the 5x5 prism
face exactly, you will need to scale it as well.
(see 3.5.1.5.1  Specifying an Image Map)

-tgq


Post a reply to this message

From: cpmac
Subject: Re: cannot open png file
Date: 6 Apr 2006 08:30:01
Message: <web.443508aaf7526d8d947d37e00@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> "cpmac" <web### [at] cpmaccom> wrote:
> >  #declare panel= prism {
> >     linear_sweep
> >     linear_spline
> >     0, // sweep the following shape from here ...
> >     0.01, // ... up through here
> >     4, // the number of points making up the shape ...
> >     <0,0>, <5,0>, <5,5>, <0,5>
> >      texture {
> >       pigment{
> >       image_map {png "noddy2.png"
> >         }
> >        }
> >
> >       }
> >  rotate<-90,0,0>
> >  translate<0,6,0>
> >  scale 0.5
> >   }
> > The file parses with no error message but no visible result.
> > How is an image file supposed to adapt to it's suport. The image file has a
> > transparent part. Could it be that only the transparent part is on the
> > panel?
> >
> > cpmac
>
> You should prisms are created as curves on the x-z plane and swept through
> the y-axis.  On the other hand, image_maps are mapped on the x-y plane and
> swept through the z-axis.  In order to get what I assume you are expecting,
> you need to rotate the image_map to suit the prism face orientation.  Also
> note that image_maps are mapped from <0,0> to <1,1> and repeated (unless
> the once keyword is used) so if you want the image_map to fit the 5x5 prism
> face exactly, you will need to scale it as well.
> (see 3.5.1.5.1  Specifying an Image Map)
>
> -tgq

Thanks for the advice . I'll look into all that.
I did manage to solve my problem by adapting the "sign" from the cliche
sample in POV. That uses a "superellipse"
From my trials and errors I seems to me that the image map format must be
the same as the set output format. In the standard setting of BMP output
the script wouldn't work with a png, but with +FN in the control box, the
png file was read and the output was a png file.


Post a reply to this message

From: Trevor G Quayle
Subject: Re: cannot open png file
Date: 6 Apr 2006 09:10:00
Message: <web.4435121ef7526d8d6c4803960@news.povray.org>
"cpmac" <web### [at] cpmaccom> wrote:
> From my trials and errors I seems to me that the image map format must be
> the same as the set output format. In the standard setting of BMP output
> the script wouldn't work with a png, but with +FN in the control box, the
> png file was read and the output was a png file.

No, you can mix any valid input filetype with any valid output type, they
are independent of each other.  Just make sure that the image_map
declaration and the POV settings are formatted so that POV can locate the
image file. See:
"3.1.2.5.4  Library Paths" & "1.2.7  I/O Restrictions"

The image file either needs to be 1)in the current.pov file working
directory, 2) in the .ini file library paths, or 3) set explicitly in the
image_map declaration.
Along with this, you need to make sure that your I/O restrictions allow for
the declaration method you used.

I personally like to store all macros, images, includes etc. in specific
library directories and have these specified in the .ini library paths.

-tgq


Post a reply to this message

From: Trevor G Quayle
Subject: Re: cannot open png file
Date: 6 Apr 2006 09:20:00
Message: <web.4435147ef7526d8d6c4803960@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> "cpmac" <web### [at] cpmaccom> wrote:
> > From my trials and errors I seems to me that the image map format must be
> > the same as the set output format. In the standard setting of BMP output
> > the script wouldn't work with a png, but with +FN in the control box, the
> > png file was read and the output was a png file.
>
> No, you can mix any valid input filetype with any valid output type, they
> are independent of each other.

Sorry, if the image_map type is NOT specified, then POV does expect the same
type as set for output (3.5.1.5.1  Specifying an Image Map).  However, you
can use ay allowable type as long as you explicitly specify the type (which
is a good habit to get into so you don't run into these types of problems)
-tgq


Post a reply to this message

From: Kenneth
Subject: Re: cannot open png file
Date: 7 Apr 2006 19:35:01
Message: <web.4436f6a8f7526d8d8ad7a9060@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> "Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> > "cpmac" <web### [at] cpmaccom> wrote:

> > No, you can mix any valid input filetype with any valid output type, they
> > are independent of each other.
>
> Sorry, if the image_map type is NOT specified, then POV does expect the same
> type as set for output (3.5.1.5.1  Specifying an Image Map).  However, you
> can use ay allowable type as long as you explicitly specify the type (which
> is a good habit to get into so you don't run into these types of problems)
> -tgq

Actually, there do seem to be a couple of odd problems here; I've come
across them myself.  At least when using the INI file for setting output
options.

Problem #1: Using POV for Windows (which has .bmp as a default output
format), I can't specify  image_map{bmp "my_image.bmp"}  because it
generates an error mesage: "undeclared identifier 'bmp' found." So I have
to specify it this way:  image_map {"my_image.bmp"}. Rather odd.

Problem #2: If I switch the output file format to .png in the INI file (by
using Output_File_Type=N), then NO version of a .bmp image_map works--the
error message is then, "Cannot read PNG image." Even though the image_map
*isn't* a .png image.

This happens no matter what the Script I/O Options are set to.

Any clue what's going on?

Ken


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.