Page MenuHome

Image pixel values change on reload of image
Closed, ArchivedPublic

Description

System Information
Operating system: Windows 10 Pro Version 1803
Graphics card: Nvidia GTX980
Graphics drivers: 430.86
Processor: Intel Core i5-6600K
RAM: 8GB @ 2400MHz

Blender Version
Broken: 2.80 (sub 74), branch: blender2.7, commit date: 2019-06-14 23:24, hash: 0fd96b4128ff, type: Release

Short description of error
Pixel values increase when a picture is loaded, saved, and reloaded using the Blender API.

Exact steps for others to reproduce the error



Open a new blender file, create a new script and type:

import bpy

# path is the filepath of the image
path = "path/to/image.png"
loadedImage = bpy.data.images.load(path)
print(loadedImage.pixels[0:6])
loadedImage.save_render(path)
bpy.data.images.remove(loadedImage)

loadedImage = bpy.data.images.load(path)
print(loadedImage.pixels[0:6])

An example of the first print statement output in the console

(0.27450981736183167, 0.27450981736183167, 0.27450981736183167, 1.0, 0.27843138575553894, 0.27843138575553894)

Second print statement produces:

(0.30588236451148987, 0.30588236451148987, 0.30588236451148987, 1.0, 0.30980393290519714, 0.30980393290519714)

Details

Type
Bug

Related Objects

Event Timeline

Jacques Lucke (JacquesLucke) triaged this task as Needs Information from User priority.

I'm not able to reproduce the issue the issue.
Can you reproduce the issue with any image or just with this one?

I tested three random images I pulled from google, all of them have the same problem. The zip file contains the blend file I used (which has the script in it) and the original three images used, as well as what they turned out after running the script 10 times on them.


Any suggestions on how to proceed?

Jacques Lucke (JacquesLucke) raised the priority of this task from Needs Information from User to Needs Triage by Developer.Tue, Jun 18, 10:24 AM
Sebastian Parborg (zeddb) triaged this task as Confirmed, Medium priority.

@Brecht Van Lommel (brecht) Color management transform is saved. But I guess this is expected because the saving is done by save_render?

(Actually I think this has already been reported before, but I can't find the ticket ATM)

Use save instead of save_render, the result is not expected to be the same when applying view transforms, dithering, etc.