Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 27, 2010, 10:37 AM   #1
artbeat.easy
macrumors newbie
 
Join Date: Jul 2010
how convert image to png ?

Hello i have some pic in some format ( jpg/gif/jpeg ) i want convert pic to png format how i can do ?
artbeat.easy is offline   0 Reply With Quote
Old Jul 27, 2010, 10:39 AM   #2
robbieduncan
Demi-God (Moderator)
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
Open them in preview and save them as a PNG?

On a more serious note since you posted it in Mac Programming: what programming language? What have you already tried? What did Google tell you? Which documents have you already read?
robbieduncan is online now   0 Reply With Quote
Old Jul 27, 2010, 10:39 AM   #3
ergdegdeg
Demi-Goddess (Moderator)
 
ergdegdeg's Avatar
 
Join Date: Oct 2007
Location: Nebraska
You can open the picture in Preview and just save it as a .png.
ergdegdeg is offline   0 Reply With Quote
Old Jul 27, 2010, 10:50 AM   #4
artbeat.easy
Thread Starter
macrumors newbie
 
Join Date: Jul 2010
me need code to convert image in my cocoa project
artbeat.easy is offline   0 Reply With Quote
Old Jul 27, 2010, 11:01 AM   #5
robbieduncan
Demi-God (Moderator)
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
Quote:
Originally Posted by artbeat.easy View Post
me need code to convert image in my cocoa project
So, as per the above: What have you already tried? What did Google tell you? Which documents have you already read?

If you are expecting code written to do exactly what you want that you can then copy and paste (steal) then you are much mistaken. I will guide you to the documentation that you need but only if you demonstrate that you have attempted to solve this yourself and are willing to put some effort in yourself.
robbieduncan is online now   0 Reply With Quote
Old Jul 27, 2010, 11:30 AM   #6
artbeat.easy
Thread Starter
macrumors newbie
 
Join Date: Jul 2010
Quote:
Originally Posted by robbieduncan View Post
So, as per the above: What have you already tried? What did Google tell you? Which documents have you already read?

If you are expecting code written to do exactly what you want that you can then copy and paste (steal) then you are much mistaken. I will guide you to the documentation that you need but only if you demonstrate that you have attempted to solve this yourself and are willing to put some effort in yourself.
Hi, hm i can write on C++/c99 code for convert all image format to png and others, it's simple ), in google more, very more information about png header or other's format ! BUT i want resolve my problem with COCOA coding and use native API's

i try see classes - NSImage/CGImage but i don't see API's some like - convert/createImageWithFormat and other's for resolve my problem ! all that I have found
- CGImageSourceCreateWithURL
- CGImageCreateWithPNGDataProvider
CGImageCreateWithPNGDataProvider return image, but i don not understand, this api's return NEW image formated PNG ? or this api create image from png image ? anyway i don't see api's some like - writeImageToFile/(NSdata*)getData/ or etc for write new image to file (((

you can help me ?
artbeat.easy is offline   0 Reply With Quote
Old Jul 27, 2010, 12:27 PM   #7
robbieduncan
Demi-God (Moderator)
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
You need to look at NSBitmapImageRep, particularly the representationUsingTyperoperties:.

Cocoas imaging classes are a little more complex that it first appears. Every NSImage has one or more NSImageReps that represent the image in a specific format. As you are only dealing with bitmap types you can be pretty sure than the rep created when you load the image will be a NSBitmapImageRep. If you were less sure (say you wanted a PNG of a PDF) then you would create an NSImage with no data of the correct size, add an NSBitmapImageRep to it (which you create), lock focus on it, draw the image that you want into that context and unlock the focus. You now have a NSBitmapImageRep with the contents you want to use the method I linked to above.
robbieduncan is online now   0 Reply With Quote
Old Jul 28, 2010, 08:14 AM   #8
artbeat.easy
Thread Starter
macrumors newbie
 
Join Date: Jul 2010
Quote:
Originally Posted by robbieduncan View Post
You need to look at NSBitmapImageRep, particularly the representationUsingTyperoperties:.

Cocoas imaging classes are a little more complex that it first appears. Every NSImage has one or more NSImageReps that represent the image in a specific format. As you are only dealing with bitmap types you can be pretty sure than the rep created when you load the image will be a NSBitmapImageRep. If you were less sure (say you wanted a PNG of a PDF) then you would create an NSImage with no data of the correct size, add an NSBitmapImageRep to it (which you create), lock focus on it, draw the image that you want into that context and unlock the focus. You now have a NSBitmapImageRep with the contents you want to use the method I linked to above.
fnks )))
artbeat.easy is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Converting Images To 300 Dpi On Macbook berkeleynerd10 Mac OS X 5 Apr 2, 2010 11:36 AM
Convert image to text. Need program ASAP acfusion29 Mac Applications and Mac App Store 4 Nov 16, 2009 08:43 PM
Convert images to vectors iphonejudy iPhone/iPad Programming 2 Oct 6, 2009 03:07 AM
Img2icns - convert images to icons or icons to images giosquad Mac Applications and Mac App Store 1 Dec 15, 2008 10:05 AM
img2icns - The easiest way to convert images to icns files MacBytes MacBytes.com News Discussion 15 Jan 10, 2006 02:51 AM


All times are GMT -5. The time now is 05:21 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Privacy / DMCA contact / Affiliate and FTC Disclosure
Copyright 2002-2013, MacRumors.com, LLC