How to Reduce Image File Sizes?

Corel Paint Shop Pro

Moderator: Kathy_9

LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: How to Reduce Image File Sizes?

Post by LeviFiction »

Comparing the two files, the extra 2MB of data comes from the text added to the file

Here is a quick break down of both files:

2.5MB file
1 byte - header
13 bytes - IDHR
43 bytes - text
2.47MB - text
7 bytes - time last edited
9 bytes - aspect ratio and physical units
4 bytes - Gamma
95.2 Kb - Image data
4 bytes - End tag

95kb file
1 byte - header
13 bytes - IDHR
7 bytes - time last edited
9 bytes - aspect ratio and physical units
4 bytes - Gamma
95.2KB - Image data
4 bytes - End tag
https://levifiction.wordpress.com/
User avatar
flagpole
Posts: 535
Joined: Wed Sep 14, 2011 10:12 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Gigabyte B450 AORUS ELITE DDR4 USB 3.1 RGB
processor: Ryzen 2600
ram: 16GB
Video Card: RTX 2060
sound_card: on board
Hard_Drive_Capacity: 6.5TB
Monitor/Display Make & Model: Iiyama 27"
Location: UK
Contact:

Re: How to Reduce Image File Sizes?

Post by flagpole »

Is this normal? Like is it expected behaviour to include all that text?
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: How to Reduce Image File Sizes?

Post by LeviFiction »

I am going to assume the answer is no. It takes a lot of text to make up 2MB of data. Each individual character is 1 byte. So it would, theoretically take 2 million individual characters to make up 2MB of text. Unless it was formatted in 16 bit Unicode. Then it would only take 1 million.
https://levifiction.wordpress.com/
User avatar
flagpole
Posts: 535
Joined: Wed Sep 14, 2011 10:12 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Gigabyte B450 AORUS ELITE DDR4 USB 3.1 RGB
processor: Ryzen 2600
ram: 16GB
Video Card: RTX 2060
sound_card: on board
Hard_Drive_Capacity: 6.5TB
Monitor/Display Make & Model: Iiyama 27"
Location: UK
Contact:

Re: How to Reduce Image File Sizes?

Post by flagpole »

So we could call this a bug?
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: How to Reduce Image File Sizes?

Post by LeviFiction »

THat would depend on whether or not the text in this one case is valid or just filled with a bunch of empty space. My computer is in the middle of an upgrade. So I can't actively test this at the moment.
https://levifiction.wordpress.com/
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: How to Reduce Image File Sizes?

Post by LeviFiction »

Okay the upgrade is over. And rather bizzarely I can't tell you if it's a bug or not. It's probably unintended, but I don't know if it falls into the realm of a "bug".

That text, is your edit history. Every change and edit you performed on that image. Including selections, selection points, selecting new layers, etc. Everything.

It starts off with a freehand selection, which has a lot of points.
moveselection
moveselection
selectpromote
select one layer down
eraser
eraser
select none
eraser
eraser
freehand selection
etc etc etc
paint brush
etc
and on and on and on

Just a lot of the history from the PSPImage file. And it was made longer because it's written in XML and they use "	" for tabs and "&#xd" for return carriage and "
" for new lines. And there are a lot of tabs, newlines, and carriage returns. So these items that traditionally are only 1byte long are being increased to 5 bytes each. And it's all perfectly valid normal XML. One of your brush strokes is 129 lines long. Each line has one or at most 3 tabs per line, and each line has one carriage return and one new line character. Looking at just the path data 52 lines long. Three tabs each line. So that's 780 bytes. The carriage returns are 520 bytes. So just the path data for a single brush command is 1.26KB large. And it only takes 1024 of those to make a MB.

Exchanging all of the "	" and so on codes with their single byte equivalents reduced the file size by 0.6MB. There are probably other encodings and things, but the rest is the history.

So, as long as the history is in there it is in fact perfectly valid that the history is taking up such a large bit of data.
https://levifiction.wordpress.com/
User avatar
flagpole
Posts: 535
Joined: Wed Sep 14, 2011 10:12 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Gigabyte B450 AORUS ELITE DDR4 USB 3.1 RGB
processor: Ryzen 2600
ram: 16GB
Video Card: RTX 2060
sound_card: on board
Hard_Drive_Capacity: 6.5TB
Monitor/Display Make & Model: Iiyama 27"
Location: UK
Contact:

Re: How to Reduce Image File Sizes?

Post by flagpole »

Thanks for your time.
Post Reply