processing / processing/processing4

.tga PImage flips y axis after save() and load()

未关闭
#827 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug core
主要语言
Java
星标
494
派生
183
平均合并
4 小时 39 分钟
30 天内合并 PR
3

描述

Created by: Sebastian5

Description

ONLY when pixels are saved ( PImage.save() ) as .tga and loaded again ( loadImage() ) they are fliped on the y axis.

Expected Behavior

That the image doesnt flip.
The demo code should show the red dot in the top left corner, not the bottom left.

Current Behavior

It is unclear whether the PImage.save() or loadImage() function is the root of the bug.

The Problem does NOT occur when:
If you save and image as .tga and open it with Paint.net: looks correct in Paint.net, not flipped
If you load an .tga created from Paint.net: looks correct in Processing, not flipped

But for .tga images that were PImage.save() and loadImage(). It flipps the pixels. It is very strange

Steps to Reproduce

PImage img1 = createImage(5, 5, RGB);
img1.pixels[0] = color(255,0,0); // left top corner must be red
img1.updatePixels();
img1.save("img.tga");

PImage img2 = loadImage("img.tga"); // comment out after using Paint.net to re-save image non corrupt
image(img2,0,0, width, height);

Your Environment

  • Processing version: 4.3
  • Operating System and OS version: Windows 10 Pro 22H2
  • Other information: AMD GPU Andrenail 23.12.1, Intel CPU

Possible Causes / Solutions

Maybe there is file desciptor flag to flip an image in the y axis.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

先从涉及 .tga 处理的 PImage.save() 和 loadImage() 路径开始,然后在 Processing 4.3 上运行所提供的 5×5 复现。跟踪保存或加载是否会改变像素的垂直顺序;完成的标准是保存并加载 TGA 后红色像素仍位于左上角。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
computer-graphics
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。