Jump to content
WnSoft Forums

Reducing the file size of a PNG...[Resolved]


trailertrash

Recommended Posts

Andrew,

Yes, you can Re-size Png's ~ you need an 'Image-Editor' which edits Png's

such as "Photo-Filtre" which is an excellent Image-Editor.

Excuse the quality as the Screenshot was a Gif before saving as a Png and

then resizing the Png twice. Png is capable of giving superb quality as it

is a "lossless" format despite multiple-saves, compared to JPeg multi-saves.

Link:-

http://photofiltre.free.fr/download_en.htm

Below are 3 Images which prove the point, the 3rd. Image gives 'Saving-details,

Hope this helps...

Brian (Conflow)

post-1416-126598181293_thumb.png

post-1416-126598182601_thumb.png

post-1416-126598184195_thumb.png

Link to comment
Share on other sites

Hi Andrew,

First you need to be very careful with your choice of words. If I understand you correctly I don't think you were originally referring to "resize" but rather compress in terms of storage. You can "resize" any type of file in terms of pixel dimensions, but some file types are generally "uncompressed" so that if you want smaller file storage size you must change the "dimensions" in terms of the number of pixels on the horizontal and vertical axis.

If you change the number of pixels (dimensions) then the amount of "bits, bytes, megabytes, etc." will change accordingly. You can re-dimension any file type.

Second, you probably don't want to make a GIF file rather than a PNG because you loose millions of possible colors. GIF files have very limited colors while PNG's have the same number of color possibilities as jpg's or tiff's.

Finally, if you are using a later version of PTE, you should be able to load gif files with no problems. PTE sees GIF's just as it does jpg's and png's.

Best regards,

Lin

Link to comment
Share on other sites

Ok here goes. I must try to explain myself better.

I want to reduce the ' megabyte ' size of the png. Aslo preserve the outer transparancy of the image. That is the area around the image which has no colour content.

Ken I tried the online editors and they saved it with just a small reduction in file size.

Brian, I downloaded the programme you suggested and had a go with it, but I cant see how to preserve the transparancy of that outer edge, and it's important.

Any more help!

Lin, I'll try to do better in how I explain the problems. I do thank you for taking the trouble to assist.

Kindest regards

Andrew

Link to comment
Share on other sites

Hi Andrew,

Tell me which image editor you have. If you don't have one which allows resize then download the freeware Irfanview. Almost any of the editors will let you resize your PNG file and in resizing, you lower the pixel count thus also make the storage size smaller.

http://www.irfanview.com

What are the dimensions of your PNG file? Resizing will not change the transparency, only make the overall dimensions smaller. You can always change the "zoom" in PTE which does not affect the original file in terms of storage requirements.

Also, if you can "crop" any of the transparency around the image, that will automatically reduce the megabyte size. For example, if you have a 1024x768 size PNG file and "most" of it is transparency, just use the crop tool and crop away the majority of the transparency thus leaving the main image surrounded by a tiny bit of transparency. Even a couple pixels of transparency around the object will retain the object's full surround as transparent.

Better yet, post a link to the file you want resized and we can quickly do that and see what the differences are in "megabytes."

Best regards,

Lin

Link to comment
Share on other sites

Hi Guys,

Keep in mind that no matter how "compressed" a file is for storage purposes, it will still expand to its full "uncompressed" size in memory. So if the purpose of compression is for storage or to reduce the size of a download, etc., then compression of jpg, png, tiff, etc., can be useful. However, if the reason for trying to make the file size smaller is to facilitate the processor or memory of the computer or GPU, then compression doesn't help and what you need to do is to reduce the "dimensions" of the file to conserve memory, etc.

As long as there is no compromise in image "quality" then reducing dimensions can be an effective way of reducing the load on the CPU or GPU and perhaps making the zooms, pans, etc., run more smoothly. But "compressing" the file, though helpful for reducing upload or download times, has no beneficial effect in terms of smoothness of playback, etc. So utilities which do lossless compression of files will not help for this purpose.

Best regards,

Lin

Hope, you already tried PNGOut compressor?

Link to comment
Share on other sites

Andrew,

It looks to me as if you had not examined the full 'functionality' of "Photo-Filtre Image Editor".

This is an extremely powerful Image-Editor and takes a little time to explore its functionality

and by way of example I have spent some time in doing what you want.

Examples below:

a) In all circumstances

The Grey 'Foto-Mask' example has an opacity of 50% and has 'Fixed-Size'.600x450.pixel

This 600x450.pixel Mask is only 2.Kb in size.

B) Image X-01 below is 406.kB (Total) and the Picture (within the Mask)= 500x375 pixel.

c) Image X-02 below is 276.kB (Total) and the Picture (within the Mask)= 400x300 pixel.

d) Image X-03 below is 156.kB (Total) and the Picture (within the Mask)= 300x225 pixel.

e) Image X-04 below shows:How to do this with Photo-Filtre, there is no other easy way.

f) Image X-05 below shows the File-structure of 'Photo-Filtre' and the Masks-Folder etc.

Firstly, to start the process you must select a Mask or make your own Mask and Save-As

into the 'Photo-Filtre' Mask Folder. Now select your Photo and resize it,now select the

Mask and paste the Photo into it and Save again.

This should satisfy your criteria of:- Fixed Mask-Size but Reduced Photo-Size and also

reduced File-Size (approx: 3:1 ratio). All edited in PNG-Format.

Brian (Conflow)

post-1416-126603614965_thumb.png

post-1416-126603616516_thumb.png

post-1416-126603618024_thumb.png

post-1416-126603619038_thumb.png

post-1416-126603648815_thumb.png

Link to comment
Share on other sites

Well this is getting complex. I now realize how poorly I explain things, so will try to do better.

This is what I'm trying to do:

The example image has a rounded stroke [border] which I want to retain. The area outside the border [the red stroke] is transparent and I need it to remain so in order that when it moves around the screen the area outside the border doesnt have a colour [in this case black] which will overlap any other image, thus showing the outside colour as it passes over/round it.

The whole point of this is to retain the rounded corners of the image rather than just the standard square corners.

So in summary the area outside the red border [in this case black being a .jpg] would normally be transparent in a .png file. I would like to retain that transparency, but have a manageable sized file at the same time.

Thats maybe a request to far tho!!!!

Andrew

post-6715-12660547444_thumb.jpg

Link to comment
Share on other sites

Andrew,

By the sound of things, you're going to be using this PNG file as an object which you will then animate to give it motion. You don't have to have your PNG file and your Main Image file at exactly the same size (expressed as pixels by pixels). Your main images might all be 1024x681, for example, if they started as 3:2 aspect ratio. Your PNG file could be, for example: half-size = 512x340 pixels. If you place this PNG file as an independent object (not the child of any parent) and then use the Zoom values to change its visible size, everything outside the area covered by the PNG image will be seen from the underlying image. You don't have to cover all of the main image with transparent data.

Is that where your mis-understanding lies?

regards,

Peter

Link to comment
Share on other sites

Hi Lin,

Keep in mind that no matter how "compressed" a file is for storage purposes, it will still expand to its full "uncompressed" size in memory.

Thanks for explanation (I think it's quite obvious for the most of us, though).

But the topic's called "Reducing the file size of a PNG...", so my answer's about reducing file size, nothing more.

Link to comment
Share on other sites

Andrew,

So far there has 20 (complete) downloads of my (above) Post, so there seems

to be some interest in this problem. I must confess I'm still confused so may

I ask a few questions,viz:

You wrote as follows which I parsed point by point,viz:-

"The example image has a rounded border which I want to retain".

O.K I understand that.

"The area outside the Red-border is transparent and I need it to remain so"

Yes, understood that !

"So that when it moves around the screen"

Why should it move around the Screen ?

What are you trying to do, Slideshow,Flash Video -What ??

Thus showing the outside colour as it passes over/round it.

Well it would.

"The whole point of this is to retain the rounded corners of the Image rather than

just the standard square corners"....

Now we are getting to the point !

Andrew I think you are making this exercise unduly complicated ~ Why not start with

a 'Rounded-Corner Image in the 1st.place ??

You need a 'Photo Frame Program' such as "Pos Free-Photo Editor" (see attachment)

and I would be surprised if Photoshop had not got a suitable 'Plug-In' to do this.

Alternatively you need to trawl the Web to find one ~ there are many.

Brian (Conflow)

post-1416-126606505665_thumb.png

Link to comment
Share on other sites

Hi all,

First let me say how much I appreciate your patience with me and this question.

I suppose simply put I should have asked "How do I keep the transparency"

The image would be moving on the screen - yes but I was hoping to be able to have all the slides the exact same size [my mind still thinks like an old soldier]

and thus not have the black edges covering up any part of the image below /behind as it changes. There is an example of this in the 3D transitions.

Photoshop can create the rounded edges with no problem and then they can be imported into a png file to preserve the outer transparent edges.All other programmes seem to flatten the image which then 'colours' the transparent area outside the 'stroke/border'

A weighty issue indeed this one.

Andrew

Link to comment
Share on other sites

OK I've got it. By jove I've got it. Having created the rounded corner image I had to put them on a transparent BG to get the required effect. This had to be a .png file to preserve the transparancy. OK so far.

However I never noticed that when creating the .png file [file>new>]

the resolution was set at 400dpi this with a big file to begin with created...well a humungus file.

So the solution is to create the new .png file at say 75dpi and then paste the rounded image into it and resize to a more manageable file both dimention wize and meg size.

I'm so sorry I didnt explain myself suffeciently to begin with, but eventually you all managed to get me to a solution, for which I am very grateful.

You all have the patience of saints..

Andrew

post-6715-126607453807_thumb.jpg

Link to comment
Share on other sites

Andrew,

Well we all need a "Memory-jog" now and then and sometimes a 'new-aproach' such as the Rounded-Photo

I mentioned ~ funny thing I just had my Son here beside me and he done it in a few minutes with CS4

Photoshop where you can choose the 'pixel-depth' on the Rounded-arc's..."se la vie".

Also thats a very nice Photo-composition which you showed in your attachment.

Brian (Conflow)

Link to comment
Share on other sites

Hi Dimmy,

Understood.. The reason for my reply was that it wasn't clear to me why Andrew wanted to reduce the file size and whether he understood that compressing a file would not help with other than storage capacity or transfer loads and times. It was only your suggestion for the compression software that prompted the general reminder; it wasn't really directed at anyone in particular.

Perhaps many of us who have extensive experience with file formats understand compression and how files behave in memory, but actually there are "many" who post here who apparently don't. The fact that I have had numerous emails about my "puzzle" test files which exploit these differences tells me that there is still lots of confusion. Two executable files having virtually identical sizes by virtue of their components behave totally differently because of compression of the component files. One works very smoothly in almost any system, while the other, which expands in memory, can challenge even very good GPU's. To many observers who don't realize that components in one of the executables have been greatly compressed, it seems to be a very strange situation.

What I've been trying to determine is "why" Andrew wants a smaller file size. Is it because of jerky pans, stutter, slow loading, or other memory or GPU related issues or just because he wants to be able to load the exe file on limited space media or to conserve space for a lengthy show on a CD, etc.?

My point is that by changing pixel dimensions via crop, the true file size and all that implies will be diminished. By compression, only the load times, transfer times and storage capacities will be affected and there will be no real differences in performance viz the GPU or CPU.

Best regards,

Lin

Hi Lin,

Thanks for explanation (I think it's quite obvious for the most of us, though).

But the topic's called "Reducing the file size of a PNG...", so my answer's about reducing file size, nothing more.

Link to comment
Share on other sites

A simple rule I always follow is never to make any animated inset image any bigger than the biggest it will be needed on screen. (This assumes the intention is to animate the png) If you create the Png in Photoshop, use the preceeding image in layers as a reference to scale the png. The preceeding image is then turned off and the transparent edged Png created.

When you import the Png into the Object and Animation screen in PTE, you will have to set the size position in pixels to 100% or PTE will expand the png to fill the screen and that will affect quality.

This works in most cases unless your intention is a long zoom, but it certainly is the best way to go if your animation is only using a maginal zoom or perhaps no zoom at all. It keeps the EXE file size down, retains quality and doesn't overload recources.

Link to comment
Share on other sites

Thank you all for the very educational advice. So many factors affect the final outcome that its nearly impossible to be aware of them all.

My final intention was a simple [turned out to be anything but] image with rounded edges moving over/and out of the way, to reveal an image below also with rounded edges [an effect I quite like]

Part of the problem was that I wasnt setting the correct dpi for the 'parent' transparent .png and I was not resizing the finished article properly.

However I have had several goes at it and it seems to work very well indeed. Also the resizing and proper compression of the file make for a much more manageable final file [from 4.6 meg to 800k]

Now thats success. Thank you all.

I wonder what daft question I can ask next... :lol::lol::lol:

Andrew

Link to comment
Share on other sites

Andrew,

Once or twice in your posts you mentioned "dpi". "Dpi" stands for "dots per inch" and is used only by the printer driver software when printing an image. When preparing images for display on a monitor, projection via a digital projector or for conversion into a video stream the choice of "dpi" does not matter - and does not influence the final file size. The only factors that affect the size (in bytes) of the image file are:

- the width and height dimensions expressed in pixels

- the compression factor used when saving to JPEG

Saving to PNG, as far as I know, uses a fixed compression value (i.e. unlike JPEG we have no control over how much).

Which JPEG compression level to use is a amatter of choice, but in support of a recent thread about compression I polled the views of the members of my local AV Group. Values between between 6 and 12 were being used. Perssonally, I use level 8.

Once you have decided which JPEG level you are going to use, then the only factor that determines the final image file size is the image size expressed as pixels by pixels.

To satisfy yourself about the irrelevance of dpi for a displayed image, take one of your existing images and then resize it to the same width and height but choosing Resolution values of, say, 7, 70, 700, 7000 dpi. The file sizes in KB should be the same (to within rounding error) and the images should appear identical when displayed.

regards,

Peter

Link to comment
Share on other sites

Hi Peter, I'm read up on that this morning and my head hurts. :lol:

However I seem to have found my answer by accident or design, I dont know.

I've said it before and I'll say it again " You guys are genius's "

I've attached an example of the thing I was trying to do. I think the outer border of the BG is a little strong [5px stroke] so I'll do a new one of that, but basically this is what I wanted.

I must stop calling resolution dpi!!!

Andrew

example.zip

Link to comment
Share on other sites

Andrew,

Dpi is a measure of resolution - for a printer. For a displayed image the only resolution is the pixel by pixel dimensions. The important point is that you have resolved your problem to your satisfaction - and have advanced your knowledge at the same time. That's called progress - and learning as you go!

regards

Peter

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...