# Not the same result with version 4.4.1 and 4.4.6 using "copy" function with PGraphics into PImage

**URL:** https://discourse.processing.org/t/not-the-same-result-with-version-4-4-1-and-4-4-6-using-copy-function-with-pgraphics-into-pimage/47024
**Category:** Processing
**Created:** [August 27, 2025, 12:16pm UTC](https://discourse.processing.org/t/not-the-same-result-with-version-4-4-1-and-4-4-6-using-copy-function-with-pgraphics-into-pimage/47024 "2025-08-27T12:16:19Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![fredciel](https://avatars.discourse-cdn.com/v4/letter/f/a87d85/32.png) [@fredciel](https://discourse.processing.org/u/fredciel)
#### Post date: [August 27, 2025, 12:16pm UTC](https://discourse.processing.org/t/not-the-same-result-with-version-4-4-1-and-4-4-6-using-copy-function-with-pgraphics-into-pimage/47024/1 "2025-08-27T12:16:19Z")

</div>

Hello,

here’s a piece of code that doesn’t give the same result in versions 4.4.1 and 4.4.6.  
The result is normal in 4.4.1, and the entire image is copied into the “Preview” variable.  
With version 4.4.6, only the top-left corner is copied.

(Mac Intel version)

fred

```auto
PImage img; 
PGraphics Graphics; 
PImage Preview;

```

```auto
void setup() {

size(1000, 1000, P2D);
img = loadImage("sunset.jpg"); // Load the image into the program
Graphics = createGraphics(width, height, P2D);
}

```

```auto
void draw() {
Graphics.beginDraw();
Graphics.image(img, 0, 0, Graphics.width, Graphics.height);
Graphics.endDraw();
Preview = createImage(200, 200, RGB); 
/// This next line will copy the all Graphics into preview with version 4.4.1 
// and only a part of it with version 4.4.6 
Preview.copy(Graphics, 0, 0, width, height, 0, 0, Preview.width,Preview.height); 
image(Preview, 0, 0, width, height); 
}

```

---

<div class="post-metadata">

### Author: ![fredciel](https://avatars.discourse-cdn.com/v4/letter/f/a87d85/32.png) [@fredciel](https://discourse.processing.org/u/fredciel)
#### Post date: [August 27, 2025, 12:39pm UTC](https://discourse.processing.org/t/not-the-same-result-with-version-4-4-1-and-4-4-6-using-copy-function-with-pgraphics-into-pimage/47024/2 "2025-08-27T12:39:49Z")

</div>

Hi , I just found the solution .

This fix the problem

```auto
pixelDensity(1);

```

In fact in version 4.4.1, pixelDensity = 1 by default

and in version 4.4.6, pixelDensity = 2 by default

(MacBook Pro retina screen)

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [August 27, 2025, 1:24pm UTC](https://discourse.processing.org/t/not-the-same-result-with-version-4-4-1-and-4-4-6-using-copy-function-with-pgraphics-into-pimage/47024/3 "2025-08-27T13:24:07Z")

</div>

> [@fredciel](#):
>
> Hi , I just found the solution .

Hi!

How did you find the solution?

Please read topic below and share your feedback.

Related:

> [@Processing IDE 4.4.4 does not show line in error](https://discourse.processing.org/t/processing-ide-4-4-4-does-not-show-line-in-error/46915/23):
>
> Hello Processing community! The Processing IDE also has a Troubleshooting link in the Help menu.slight_smile Direct link: The pixelDensity() is a very common issue! This would be worthy of an entry in the Troubleshooting Wiki. See recent post: Thank you! My efforts to share issues or changes is intended to streamline the communication for everyone. This may save us all some work and we could direct everyone to one place for the more common ones and educate them about these important resources…

`:)`

---

<div class="post-metadata">

### Author: ![moon](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/moon/32/21773_2.png) [@moon](https://discourse.processing.org/u/moon)
#### Post date: [August 27, 2025, 3:42pm UTC](https://discourse.processing.org/t/not-the-same-result-with-version-4-4-1-and-4-4-6-using-copy-function-with-pgraphics-into-pimage/47024/4 "2025-08-27T15:42:06Z")

</div>

Hi @fredciel. Glad you found the solution! Just one thing I would clarify about your conclusion. The default pixelDensity is not determined by version number, but is dynamically determined depending on display density.

---

<div class="post-metadata">

### Author: ![fredciel](https://avatars.discourse-cdn.com/v4/letter/f/a87d85/32.png) [@fredciel](https://discourse.processing.org/u/fredciel)
#### Post date: [August 28, 2025, 7:33am UTC](https://discourse.processing.org/t/not-the-same-result-with-version-4-4-1-and-4-4-6-using-copy-function-with-pgraphics-into-pimage/47024/5 "2025-08-28T07:33:09Z")

</div>

Hi,

I have the two versions installed on the same computer (macbook pro Intel version retina screen)

And at startup:  
println(pixelDensity);

make 1 on version 4.4.1

make 2 on version 4.4.6

So my code was not working anymore on 4.4.6 until I set the pixelDensity to 1

Have a good day

---

<div class="post-metadata">

### Author: ![sableraph](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sableraph/32/251_2.png) [@sableraph](https://discourse.processing.org/u/sableraph)
#### Post date: [August 28, 2025, 9:35am UTC](https://discourse.processing.org/t/not-the-same-result-with-version-4-4-1-and-4-4-6-using-copy-function-with-pgraphics-into-pimage/47024/6 "2025-08-28T09:35:03Z")

</div>

Hi @fredciel,

Both you and @moon are correct.

Since Processing 4.4.3, the default `pixelDensity()` is no longer fixed at 1. Instead, it automatically matches your display’s resolution. On a Retina screen that often means 2, but the exact value depends on the display.

This change was made so sketches appear sharper on high-resolution screens without requiring extra setup. The trade-off is that some image functions, like `copy()`, may behave differently, as you noticed.

The issue is being tracked in [issue #693](https://github.com/processing/processing4/issues/693) and a there is a fix in progress in [PR #1145](https://github.com/processing/processing4/pull/1145).
