• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Export a TIFF with transparency
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Export a TIFF with transparency


  • Subject: Export a TIFF with transparency
  • From: Lorenzo <email@hidden>
  • Date: Tue, 18 Nov 2003 17:36:25 +0100

Hi,
I have a TIFF document made by Photoshop. It has a transparent background.
But any time I save it with my Cocoa application, I lose the transparency of
the background. The background becomes white.

I do this:
id rep = [NSBitmapImageRep imageRepWithContentsOfFile:filePath];
[rep representationUsingType:NSPNGFileType properties:nil];
[iconFormatRep writeToFile:newFilePath atomically:YES];

No matter if I export to an NSPNGFileType or NSTIFFFileType. If the original
file is a TIFF, the final background becomes white all the time.
Instead if I use an original PNG file, I can export it like PNG or TIFF with
the transparent background.

All I have to do is to read an image, cut the size, choose the output
format, change resolution, change depth, and save. I did most of this, but
for example, in order to change the resolution I have to use the Carbon API
GraphicsExportSetResolution, so it's a mix of Carbon and Cocoa APIs.

Can anyone explain me please how to do that?
Sincerely I am a little bit confused between NSImage, NSImageRep,
NSBitmapImageRep, NSData, array of representations, TIFFRepresentation...
plus the old Carbon APIs. Maybe someone can clarify to me the basic
concepts. I have read the documentation but there are some concepts not so
clear to me.


Thank you
--
Lorenzo
email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: [OT] Re: (no subject)
  • Next by Date: Re: USB
  • Previous by thread: Export a TIFF with transparency
  • Next by thread: Using a specific keyboard (arabic) layout in a Textfield. How?
  • Index(es):
    • Date
    • Thread