Logo by mrob - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit us on facebook
 
*
Welcome, Guest. Please login or register. April 25, 2024, 10:13:28 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Images do not round-trip correctly  (Read 1182 times)
0 Members and 1 Guest are viewing this topic.
Pauldelbrot
Fractal Senior
******
Posts: 2592



pderbyshire2
« on: March 25, 2012, 07:45:42 PM »

This is weird. I was experimenting with UF5 and found this:

1. I have a direct coloring formula set all pixels to red 64/255, with a pattern in green, blue, and alpha.

2. I export the image as a png with transparency.

3. I examine the image in Photoshop. The eyedropper tool reveals that the pixels have red = 64 (on a scale of 0 to 255 there).

4. I have a formula with an image parameter that takes trunc(255.0*red(col)) from the color of the image pixel corresponding to the screen pixel, tests it for being a specific value, and produces wildly different colors based on the other components depending on whether that test returned true or false.

5. The pattern appears correctly when the image exported in 2, above, is selected.

6. However, if the test value is set to 64, nothing happens. The colors change if the test value is instead set to 53. I conclude from this that a red byte of 64 generated by formula correctly produces a red value of 64 in the (losslessly compressed) png exported, but that a red byte of 64 in an image parameter is changed to a red byte of 53 in the read-in image.

7. I change the fractal to use the standard Pixel formula and standard Image coloring, selecting the same png as the image parameter for the latter.

8. The image looks more or less as expected. I export it as a png with transparency.

9. I examine the second png in Photoshop. One particular pixel has red 53, green 0, blue 9 where the corresponding pixel in the first png has red 64, green 0, blue 12.

This seems to confirm that pngs do not round-trip correctly through Ultra Fractal. In particular, if you have an MxN png, create a blank MxN fractal, set the formula to Pixel, set the outside coloring to Image, set the image to the png, and export the result as another png, you get a png that is darker than the first png, as if a gamma correction has been applied unrequested by the user.
Logged

David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #1 on: March 26, 2012, 12:37:02 AM »

UF Win or Mac ?
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Pauldelbrot
Fractal Senior
******
Posts: 2592



pderbyshire2
« Reply #2 on: March 26, 2012, 02:29:59 AM »

Windoze Vista. But I don't think "decodes PNGs accurately and without distortion" is supposed to be a platform-specific feature ... smiley

Actually, it's quite surprising that this happens at all. There is a good, well-supported, free cross-platform png library (naturally just called "libpng") for C/C++ that you'd think would be the first choice in a native application on either OS and that you'd think would be well-tested enough by now to definitely produce an in-memory raster pixel with a red byte of 64 when fed a png with a red byte of 64. smiley
Logged

Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Halp! I can't implement Rudy Rucker's cubic mandelbrot correctly. Programming laser blaster 3 2044 Last post May 07, 2014, 10:03:07 PM
by phtolo
Correctly Spelt Quaternion Qu12 Mandelbulber Gallery mclarekin 0 732 Last post May 29, 2015, 04:09:27 AM
by mclarekin
Correctly Spelt Quaternion Qu15 Mandelbulber Gallery mclarekin 1 854 Last post August 23, 2015, 04:43:07 PM
by zebastian
Correctly Spelt Quaternion Qu18 Mandelbulber Gallery mclarekin 0 495 Last post September 13, 2015, 01:24:39 PM
by mclarekin
Bug: Newton-Raphson not working correctly Kalles Fraktaler Pauldelbrot 2 4180 Last post August 10, 2016, 01:30:13 PM
by Kalles Fraktaler

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.139 seconds with 26 queries. (Pretty URLs adds 0.006s, 2q)