Post Reply 

Flatten without losing transparency

Nov 5, 2012, 19:41
Post: #1
Flatten without losing transparency
Is there an easy way to flatten without losing transparency?
Find all posts by this user
Quote this message in a reply
Nov 5, 2012, 19:57 (This post was last modified: Nov 5, 2012 19:57 by ofnuts.)
Post: #2
RE: Flatten without losing transparency
Flattening doesn't discard transparency, if all layers support it ("Layer/Transparency/Add alpha channel"). There are however "flat" file formats that support transparency completely (PNG), partially (GIF), and none at all (JPG). See "Image formats" in my sig for more info.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Nov 5, 2012, 20:04 (This post was last modified: Nov 5, 2012 20:05 by PaulSlocum.)
Post: #3
RE: Flatten without losing transparency
(Nov 5, 2012 19:57)ofnuts Wrote:  Flattening doesn't discard transparency

It sure seems to on the Mac version, perhaps it's another of many bugs in this new version. If I create a new image with one transparent layer, fill half the layer, then flatten then image, then it fills the transparent half when it executes the flatten.
Find all posts by this user
Quote this message in a reply
Nov 6, 2012, 01:11 (This post was last modified: Nov 6, 2012 01:12 by ofnuts.)
Post: #4
RE: Flatten without losing transparency
(Nov 5, 2012 20:04)PaulSlocum Wrote:  
(Nov 5, 2012 19:57)ofnuts Wrote:  Flattening doesn't discard transparency

It sure seems to on the Mac version, perhaps it's another of many bugs in this new version. If I create a new image with one transparent layer, fill half the layer, then flatten then image, then it fills the transparent half when it executes the flatten.

Hmm. Can you attach a sample XCF here (before flattening)?

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Nov 6, 2012, 02:54
Post: #5
RE: Flatten without losing transparency
http://qotile.net/temp/Untitled.xcf
Find all posts by this user
Quote this message in a reply
Nov 6, 2012, 08:02
Post: #6
RE: Flatten without losing transparency
Hmmm. You're right, "Image/Flatten image" removes the transparency. That's exactly what is written on the box:

[attachment=1590]

On the whole flattening the image explicitly is seldom a good thing to do, because it cannot be undone without reverting all other changes (Ctrl-Z), and it's usually useful to keep the distinct layers around.

Since flattening the whole image is automatic when you export to flat files, without loss of transparency if the file format supports it (PNG), there is no need to explicitly flatten the image before exporting it.

If you have few layers, you can merge them down one by one.

You can also use "Layer/New from visible" to create a new layer that is the composite of all visible layers (this is your flattened image) or "Edit/Select all", "Edit/Copy visible" and "File/Create/From clipboard" (Ctrl-A, Ctrl-Shift-C,Ctrl-Shift-V) to obtain a new image with your flattened layers.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Nov 8, 2012, 15:50
Post: #7
RE: Flatten without losing transparency
(Nov 6, 2012 08:02)ofnuts Wrote:  On the whole flattening the image explicitly is seldom a good thing to do, because it cannot be undone without reverting all other changes (Ctrl-Z), and it's usually useful to keep the distinct layers around.

I need to flatten in order to resize the image to export at different resolutions for my iOS projects. Without flattening, resizing of an image results in artifacts, and is also very slow.
Find all posts by this user
Quote this message in a reply
Nov 8, 2012, 16:30
Post: #8
RE: Flatten without losing transparency
(Nov 8, 2012 15:50)PaulSlocum Wrote:  
(Nov 6, 2012 08:02)ofnuts Wrote:  On the whole flattening the image explicitly is seldom a good thing to do, because it cannot be undone without reverting all other changes (Ctrl-Z), and it's usually useful to keep the distinct layers around.

I need to flatten in order to resize the image to export at different resolutions for my iOS projects. Without flattening, resizing of an image results in artifacts, and is also very slow.

Then IMHO you have a very good case for a workflow like:
- Copy Visible (Ctrl-A, Ctrl-Shift-C)
- Create new image from clipboard (Ctrl-Shift-V)
- Scale new image
- Export new image
- Discard new image

That will avoid flattening/scaling down the original and saving it by mistake.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Nov 8, 2012, 21:13
Post: #9
RE: Flatten without losing transparency
(Nov 5, 2012 19:41)PaulSlocum Wrote:  Is there an easy way to flatten without losing transparency?

"Flattening" = loss of transparency for any given image file. It's useful if you don't mind or need to save an image as .jpg. Otherwise, if you need to save an image's transparency layer(s), but also only want your final image to consist of a single layer (in order to save it as a PNG, for example), you must:
>first merge all layers; you should find this option under-->Image-->Merge visible layers
>export/save as .png, tiff, bmp, etc. (any file format supporting alpha channels)

Then, any resize operations may be done on the exported/saved as image file.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Losing image quality Futant 2 272 Oct 10, 2014 16:07
Last Post: rich2005
  Transparency sanvi 1 219 Sep 25, 2014 21:08
Last Post: iForStyle007
  graded transparency for blurring? jimmyspenser 0 219 Jul 24, 2014 14:32
Last Post: jimmyspenser
  Losing Mouse control no matter what version. Dead2Fall 9 554 Jul 23, 2014 09:22
Last Post: Mont33
  Editing a jpg to replace text without losing background color scheme jon80 3 722 Jun 24, 2014 01:37
Last Post: iForStyle007

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS