POV-Ray : Newsgroups : povray.general : Image_map question Server Time
4 Dec 2024 14:12:38 EST (-0500)
  Image_map question (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: David Kraics
Subject: Image_map question
Date: 25 Nov 2023 07:35:00
Message: <web.6561e8c7ac96b3316633439fa57e0@news.povray.org>
I keep running into an issue. I image_map a jpeg onto a box. In the image
created, the jpeg's lines are greatly faded. Darkening the jpeg doesn't improve
this. Am I missing something? The one I am currently using is;


 box{<-.5,0,0>,<.5,3.097,.45>

  pigment{
    image_map{jpeg"tower.jpg"}
    scale<1,3.097,1>
    translate<-.5,0,0>
    }
 }

The scale is to match the box it is on.
The original jpeg is a blueprint with firm solid black lines. The image is
greatly faded. Am I missing a function or someting?


Post a reply to this message

From: Bald Eagle
Subject: Re: Image_map question
Date: 25 Nov 2023 11:00:00
Message: <web.656218d44becaf921f9dae3025979125@news.povray.org>
"David Kraics" <bar### [at] aolcom> wrote:

> The original jpeg is a blueprint with firm solid black lines. The image is
> greatly faded. Am I missing a function or someting?

Sounds like gamma.
You're going to have to read up on whether your image is gamma corrected, and
all of that.
If you pull up the wiki entry on image map, it ought to have some parameters you
can adjust.
You might be able to load your image into a viewer and get some kind of encoding
data from a drop-down menu.

- BW


Post a reply to this message

From: Alain Martel
Subject: Re: Image_map question
Date: 25 Nov 2023 13:08:50
Message: <65623832$1@news.povray.org>
Le 2023-11-25 à 07:29, David Kraics a écrit :
> I keep running into an issue. I image_map a jpeg onto a box. In the image
> created, the jpeg's lines are greatly faded. Darkening the jpeg doesn't improve
> this. Am I missing something? The one I am currently using is;
> 
> 
>   box{<-.5,0,0>,<.5,3.097,.45>
> 
>    pigment{
>      image_map{jpeg"tower.jpg"}
>      scale<1,3.097,1>
>      translate<-.5,0,0>
>      }
>   }
> 
> The scale is to match the box it is on.
> The original jpeg is a blueprint with firm solid black lines. The image is
> greatly faded. Am I missing a function or someting?
> 
Some things that you may try :
Adding a gamma value to the pigment. Try values more and less than 1.
Adding a layered pigment with a transmit value larger than 1 above that 
pigment.

box{<-.5,0,0>,<.5,3.097,.45>

   pigment{
     image_map{jpeg"tower.jpg"}
     scale<1,3.097,1>
     translate<-.5,0,0>
     }
// Add this
   pigment{rgbt<0.5,0.5,0.5,1.5>}
  }

A transmit of more than 1 increase the contrast, and the 0.5 make areas 
with a value less than 0.5 darker and the area with a value larger than 
0.5 brighter. There are a few sample scenes that illustrate this.

Some other things to look for :
If the black is not pure black, an ambient value that is set to large in 
a #default statement can be an issue.
Also, to much light illuminating the box tend to wash out things.
Make sure that the black is really black : RGB <0,0,0>


Post a reply to this message

From: David Kraics
Subject: Re: Image_map question
Date: 25 Nov 2023 14:10:00
Message: <web.6562463c4becaf926633439fa57e0@news.povray.org>
Alain Martel <kua### [at] videotronca> wrote:

> > I keep running into an issue. I image_map a jpeg onto a box. In the image
> > created, the jpeg's lines are greatly faded. Darkening the jpeg doesn't improve
> > this. Am I missing something? The one I am currently using is;
> >
> >
> >   box{<-.5,0,0>,<.5,3.097,.45>
> >
> >    pigment{
> >      image_map{jpeg"tower.jpg"}
> >      scale<1,3.097,1>
> >      translate<-.5,0,0>
> >      }
> >   }
> >
> > The scale is to match the box it is on.
> > The original jpeg is a blueprint with firm solid black lines. The image is
> > greatly faded. Am I missing a function or someting?
> >
> Some things that you may try :
> Adding a gamma value to the pigment. Try values more and less than 1.
> Adding a layered pigment with a transmit value larger than 1 above that
> pigment.
>
> box{<-.5,0,0>,<.5,3.097,.45>
>
>    pigment{
>      image_map{jpeg"tower.jpg"}
>      scale<1,3.097,1>
>      translate<-.5,0,0>
>      }
> // Add this
>    pigment{rgbt<0.5,0.5,0.5,1.5>}
>   }
>
> A transmit of more than 1 increase the contrast, and the 0.5 make areas
> with a value less than 0.5 darker and the area with a value larger than
> 0.5 brighter. There are a few sample scenes that illustrate this.
>
> Some other things to look for :
> If the black is not pure black, an ambient value that is set to large in
> a #default statement can be an issue.
> Also, to much light illuminating the box tend to wash out things.
> Make sure that the black is really black : RGB <0,0,0>


Added that line and the prim turned invisible. Tried autocontrast on my paint
software. I attached the file. I am using this image as a blueprint so it won't
be in the final picture, so I am just dealing with squinting for now.


Post a reply to this message


Attachments:
Download 'tower.jpg' (18 KB)

Preview of image 'tower.jpg'
tower.jpg


 

From: Bald Eagle
Subject: Re: Image_map question
Date: 25 Nov 2023 14:40:00
Message: <web.65624cc84becaf921f9dae3025979125@news.povray.org>
"David Kraics" <bar### [at] aolcom> wrote:

> Added that line and the prim turned invisible. Tried autocontrast on my paint
> software. I attached the file. I am using this image as a blueprint so it won't
> be in the final picture, so I am just dealing with squinting for now.

Well if you're just using it as a modeling aid, try using it as an
pigment_pattern {image_map} and a pigment map of rgb 0 and rgb 1.

https://wiki.povray.org/content/Reference:Pigment_Pattern

- BW


Post a reply to this message

From: Ilya Razmanov
Subject: Re: Image_map question
Date: 25 Nov 2023 15:13:27
Message: <b3b14212-34fc-431e-8790-342a4d0311fb@gmail.com>
On 25.11.2023 15:29, David Kraics wrote:
> I keep running into an issue. I image_map a jpeg onto a box. In the image
> created, the jpeg's lines are greatly faded. Darkening the jpeg doesn't improve
> this. Am I missing something? The one I am currently using is;

What happens if you convert it from greyscale to real black and white 
(and save to, say, PNG, since JPEG does not support black and white)?


Post a reply to this message

From: Kenneth
Subject: Re: Image_map question
Date: 26 Nov 2023 18:00:00
Message: <web.6563cb5b4becaf929b4924336e066e29@news.povray.org>
"David Kraics" <bar### [at] aolcom> wrote:
>
> The original jpeg is a blueprint with firm solid black lines. The image is
> greatly faded. Am I missing a function or someting?

I have no idea why some of the blueprint lines would turn to grayscale rather
than pure black.

But try this trick: Depending on what version of POV-ray you are using, a
'gamma' statement in the image_map can be used to greatly increase image
contrast. It kind of abuses the original intent of that feature, but it works;
the allowed value actually has no upper limit. Play around with this value.
(Unfortunately, the jpeg image you posted is small and rather low quality, so
the compression artifacts are also showing up.)

This camera set-up reproduces the original image 1:1. (I rendered it at 800 X
800 pixels with antialiasing.)
----

#version 3.8; // or 3.7 etc?
global_settings{assumed_gamma 1.0}
#default{finish{ambient 1 emission 0 diffuse 0}}

background{rgb .1} // optional

camera {
  perspective
  location  <.5, .5, -1>
  look_at   <.5, .5,  0>
  right     x*image_width/image_height
  // angle 67 // leave this out
}

box{<0,0,0>, <1,1,0> // a zero-thickness box is OK

pigment{
image_map{jpeg "blueprint outline from David K.jpg" gamma 12}
       }
scale <134,415,1>/415 // original pixel dimensions of posted image
}


Post a reply to this message


Attachments:
Download 'image_map_contrast_experiment_kw.jpg' (83 KB)

Preview of image 'image_map_contrast_experiment_kw.jpg'
image_map_contrast_experiment_kw.jpg


 

From: Kenneth
Subject: Re: Image_map question
Date: 26 Nov 2023 18:55:00
Message: <web.6563d9f94becaf929b4924336e066e29@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> "David Kraics" <bar### [at] aolcom> wrote:
> >
> > The original jpeg is a blueprint with firm solid black lines. The image is
> > greatly faded.
>
> I have no idea why some of the blueprint lines would turn to grayscale rather
> than pure black.
>
One possible reason just occurred to me:
If some of the black lines in your image_map image are very thin, and if you are
using antialiasing for your final render (and at a relatively low resolution),
the AA might be 'smearing' those black lines a tiny amount-- making them
'fuzzy', i.e. grayscale and not black.

Try rendering your image_map at a larger size, with no AA, to see if this helps.


Post a reply to this message

From: Kenneth
Subject: Re: Image_map question
Date: 26 Nov 2023 19:10:00
Message: <web.6563dcca4becaf929b4924336e066e29@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
>
>
> Try rendering your image_map at a larger size, with no AA, to see if this helps.

...and don't use 'interpolate 2' in the image_map. This probably does not make
much of a difference when the image_map exactly fills the final render
(in y here), but it is worth a try as well.


Post a reply to this message

From: Ilya Razmanov
Subject: Re: Image_map question
Date: 27 Nov 2023 00:16:25
Message: <65642629$1@news.povray.org>
On 27.11.2023 1:57, Kenneth wrote:
> "David Kraics" <bar### [at] aolcom> wrote:
>>
>> The original jpeg is a blueprint with firm solid black lines. The image is
>> greatly faded. Am I missing a function or someting?
> 
> I have no idea why some of the blueprint lines would turn to grayscale rather
> than pure black.
> 
> But try this trick:

Unfortunately, we don't know where the jpeg comes from. However, even 
with JPEGs (which are not intended for line drawing) there may be much 
easier solution:

1) Download and install GIMP. Following steps are given assuming you did 
it and started GIMP.
2) Scale image up, much larger than necessary. Apparently fix the 
proportions, so you don't need to interpolate image with POVRay.
3) Use Colors\Levels to make background white, lines black, and shift 
greys toward these ends so the lines look better.
4) Use Filters\Generic\Erode (that's how "Minimum" is called in GIMP) to 
make lines thiker.
5) Use "Levels" again to you taste.
6) Use Colors\Threshold to turn image into black and white (not 
greyscale or RGB, like JPEGS)
7) Save oversized B/W image as PNG to avoid further introducing JPEG 
defects.

As a result, POVRay will have much less reasons to "think" about this 
image and "do" something about it.

Ilyich


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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