# What is the libpng warning?

**URL:** https://discourse.processing.org/t/what-is-the-libpng-warning/17309
**Category:** Libraries
**Created:** [January 24, 2020, 8:04am UTC](https://discourse.processing.org/t/what-is-the-libpng-warning/17309 "2020-01-24T08:04:13Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![KEEP](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/keep/32/7910_2.png) [@KEEP](https://discourse.processing.org/u/KEEP)
#### Post date: [January 24, 2020, 8:04am UTC](https://discourse.processing.org/t/what-is-the-libpng-warning/17309/1 "2020-01-24T08:04:13Z")

</div>

![QQ图片20200124160028](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/3/3767b38b3d6c35bd3ffa929fbb709855202f03d7.png)  
Excuse me?How to solve the libpng warning ?please help me!  
thanks!

---

<div class="post-metadata">

### Author: ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)
#### Post date: [January 24, 2020, 10:32am UTC](https://discourse.processing.org/t/what-is-the-libpng-warning/17309/2 "2020-01-24T10:32:19Z")

</div>

Welcome to the forum.

Just a couple of things, please do not include screenshots of code and error messages. Forum members cannot run the code to try and duplicate the problem and thereby find a solution.

Instead of the image copy and paste the code into the message, then select the code in the message and click on the \</\> button to format the code for this forum.

The problem in your code is that the variables (`backgroundColor`, `circleColor`, `circleStroke`) holding your colours are declared as `float` and should be `int`

---

<div class="post-metadata">

### Author: ![KEEP](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/keep/32/7910_2.png) [@KEEP](https://discourse.processing.org/u/KEEP)
#### Post date: [January 24, 2020, 10:45am UTC](https://discourse.processing.org/t/what-is-the-libpng-warning/17309/3 "2020-01-24T10:45:03Z")

</div>

thank you !  
sorry~This is my first time using the forum.  
I will paste the code into the message next time 😁  
thank you again! 🥰 🥰

---

<div class="post-metadata">

### Author: ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)
#### Post date: [January 24, 2020, 10:56am UTC](https://discourse.processing.org/t/what-is-the-libpng-warning/17309/4 "2020-01-24T10:56:54Z")

</div>

No need to apologise we all started here in the same way 😄

---

<div class="post-metadata">

### Author: ![KEEP](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/keep/32/7910_2.png) [@KEEP](https://discourse.processing.org/u/KEEP)
#### Post date: [January 26, 2020, 9:51am UTC](https://discourse.processing.org/t/what-is-the-libpng-warning/17309/5 "2020-01-26T09:51:35Z")

</div>

Hello ! teacher ! Now all my code is going to come up with this warning.  
I don`t know happened.The example of yesterday’s modification still exists and the empty documents also have this warning.😰 😰

 ![QQ图片20200126173756](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/4a666a2ae17e29e13d66d8f90a3b5e195e8e7ad3.png)  
This is my code.  
code\_1

```auto
void setup(){
  size(1000,1000);
  background(125);
}

void draw(){
  stroke(0);
  rectMode(CENTER);
  rect(200,300,300,300);
}

```

code\_2

```auto
float lineX = 512;
float lineY = 512;
float lineH = 0;
float lineW = 0;
float lineFill = 125;
float lineStroke = 0;
float backgroundColor =255;
float change = 1;

void setup()
{
  size(1024, 1024);
}

void draw()
{
  background(backgroundColor);
  stroke(lineStroke);
  fill(lineFill);
  line(lineX, lineY, lineH+512, lineW);
  line(lineX, lineY, lineH+1024, lineW+1024);
  line(lineX, lineY, lineH, lineW+1024);
  lineW=lineW+change;
}

```

code\_1 used processing 3.5.3  
code\_2 used processing 3.5.4

There were no warnings in the 3.5.3 release, but now it still appear warnings when I switch back to the old version. 😵 😵  
How to solve the libpng warning ? What is the libpng warning mean? Thanks ! Love you!! 😀 😀 😀

---

<div class="post-metadata">

### Author: ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)
#### Post date: [January 26, 2020, 10:27am UTC](https://discourse.processing.org/t/what-is-the-libpng-warning/17309/6 "2020-01-26T10:27:45Z")

</div>

I am also using Processing 3.5.4 and I have tried your 2 programs and an empty sketch and I don’t get this warning.

Since you get the warning on your computer even if you run an empty sketch it can’t be your code creating it, it must be some internal function of Processing, in which case I suggest you simply ignore it.

---

<div class="post-metadata">

### Author: ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)
#### Post date: [January 26, 2020, 10:30am UTC](https://discourse.processing.org/t/what-is-the-libpng-warning/17309/7 "2020-01-26T10:30:44Z")

</div>

Anyway I did a bit of googling and it seems that is caused when loading a png image file with an invalid iCCP chunk and can be safely ignored. There is nothing you can do about it yourself.

I notice in `code2` you did not follow my advice 😒 and change the color variables to `ints` like this.

```auto
float lineX = 512;
float lineY = 512;
float lineH = 0;
float lineW = 0;
int lineFill = 125;
int lineStroke = 0;
int backgroundColor =255;
float change = 1;

```

---

<div class="post-metadata">

### Author: ![KEEP](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/keep/32/7910_2.png) [@KEEP](https://discourse.processing.org/u/KEEP)
#### Post date: [January 26, 2020, 1:30pm UTC](https://discourse.processing.org/t/what-is-the-libpng-warning/17309/8 "2020-01-26T13:30:21Z")

</div>

😵 😵  
oh ! I got it wrong~  
I thought you meant to change the float value of the variable from 0.5 to 1  
So I changed value of the float change 😌 😌  
My English reading ability still needs to be improved.  
Thank you teacher !! I will study hard!! 😝 😝
