DPlot Forum Index DPlot
http://www.dplot.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Inserting 32b image -> feathered edge black

 
Post new topic   Reply to topic    DPlot Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
Roberto



Joined: 16 Mar 2008
Posts: 102
Location: Netherlands Beek en Donk

PostPosted: Thu Dec 31, 2015 9:05 am    Post subject: Inserting 32b image -> feathered edge black Reply with quote

Hi,

E.g. PNG images can be saved with a transparent background (color depth 32bit instead of 24bit).

When importing such an image in DPlot the transparency is correctly respected.

However, when I import a 32b PNG image with feathered edges (edges gradually in-/decreasing in transparency) the transparency opacity transition areas are instead showing a black/white transition area: when transparency is 100% then DPlot respects transparency but when not 100% it's a grey shade.

Not that DPlot should be considered a fully featured image editor but if solving this (minor) issue wouldn't involve a great deal of efforts it would be nice if someday this inconvenience could be tackled Confused
_________________
Roberto
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Fri Jan 01, 2016 1:47 am    Post subject: Reply with quote

I had not considered transparency before. I guess the first question is what do you think should happen with transparent pixels? The only obvious answer to me is that 100% transparent pixels should be ignored. But what to do with 1%-99% transparent pixels?
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Roberto



Joined: 16 Mar 2008
Posts: 102
Location: Netherlands Beek en Donk

PostPosted: Tue Jan 05, 2016 4:39 pm    Post subject: Reply with quote

Hi David,

Sorry for the late reply; forgot about my post and wasn't sure I would receive an email notification once my post was replied to.

The transparency is a fourth 'color' channel: the 'alpha' channel next to the red, green and blue channels of an individual color pixel.
The color of the pixel (r,g and b values, each having a value of 0...255) needs to be blended with the color of the pixel beneath the image containing transparency while the amount of blending depends on the 'percentage' (actually also a value of 0...255) of transparency (value of alpha channel). It's a blending of color rather than a shade of gray (eventhough a single alpha channel can be represented by a gray scale image but that's only for visualisation of the transparency 'mask').

I do not know the blending math but there is a lot to find about it on the internet; even Wikipedia covers the subject. But instead of re-inventing the wheel or figuring out the logics perhaps it's better to take advantage of other people's knowledge who are in to this matter. E.g. www.filtermeister.com is having a users group who are on a regular basis doing all kinds of things with image effects (filtermeister is a plugin on its own that is designed to develop plugins (.8bf extension) to create image effects. filtermeister and the plugins created with it can be installed to Photoshop, Paintshop Pro, Corel PhotoPaint, Serif PhotoPlus and some more image editors supporting Adobe Photoshop compatible (8bf) plugins. In that group asking the math behind how to blend an overlaying image containing transparency with the image underneath it, should give you a usable answer by one or more group members.
_________________
Roberto
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Tue Jan 05, 2016 7:32 pm    Post subject: Reply with quote

Quote:
Sorry for the late reply; forgot about my post and wasn't sure I would receive an email notification once my post was replied to.


The reply e-mail gizmo is broken, sorry.

Quote:
The transparency is a fourth 'color' channel: the 'alpha' channel next to the red, green and blue channels of an individual color pixel.
The color of the pixel (r,g and b values, each having a value of 0...255) needs to be blended with the color of the pixel beneath the image containing transparency while the amount of blending depends on the 'percentage' (actually also a value of 0...255) of transparency (value of alpha channel). It's a blending of color rather than a shade of gray (eventhough a single alpha channel can be represented by a gray scale image but that's only for visualisation of the transparency 'mask').


I know how the transparency byte in 32-bit PNG images works. Sorry I wasn't clear. The problem is DPlot doesn't care about any of that and neither does the bitmapto3d plugin. The plugin converts your image to 8 bit grayscale regardless of what you start with, then maps those 256 possible gray values to Z values. There's nothing about color (or transparency) that is preserved. I could add a transparency mask to the surface plot, but since (guessing here) something like 99.9% of users are simply plotting a surface on a white background I can't see this being especially useful. But it is worth thinking about. Thanks for your input.
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    DPlot Forum Index -> Bug Reports All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group