How to convert .png image to .xpm? (Solved)

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

How to convert .png image to .xpm? (Solved)

#1 Post by sunburnt »

I'm using the small .xpm USB images in: /usr/local/lib/X11/pixmaps for popup dialog boxes.

But I'd like to use the larger .png USB image (the one on the desktop), but Xdialog will only use .xpm

I tried mtPaint but it won't save pics. in .xpm format, I can edit the USB pic. how I want with mtPaint.

But then I need to convert the images: .png to .xpm

User avatar
darkerror05
Posts: 276
Joined: Sat 17 Jun 2006, 22:10
Location: Rochester NY, USA

#2 Post by darkerror05 »

i had the exact same problem as you. Here is a link to my solutuion http://www.murga.org/~puppy/viewtopic.p ... hlight=xpm
-darkerror

User avatar
darkerror05
Posts: 276
Joined: Sat 17 Jun 2006, 22:10
Location: Rochester NY, USA

#3 Post by darkerror05 »

hehe i was 1st lol
-darkerror

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#4 Post by sunburnt »

THANKS guys; As per usual... something always goes wrong.

I converted the .png to .xpm & the pic. works, but the transparent area around the USB pic. is colored.

I looked & didn't see a "transparent color" in the palette or a way to load one to it.

User avatar
fluxit
Posts: 326
Joined: Sat 24 Jun 2006, 04:14
Location: Ketchikan, AK USA

#5 Post by fluxit »

File, Save_As, select type XPM. You should have a checkbox next to the File_Format dropdown that is labeled "Set transparency index". This should be checked, and the number next to it should be set to the same value as the color index number you have chosen as your transparency in MTPaint's pallette.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#6 Post by sunburnt »

fluxit; Makes perfect sense to me, except I already looked for a way to set the palette index 255 to trans.
I looked again & still don't see how to do it, the only setting is it's index in the palette.

User avatar
fluxit
Posts: 326
Joined: Sat 24 Jun 2006, 04:14
Location: Ketchikan, AK USA

#7 Post by fluxit »

File, Save_As, select type XPM. You should have a checkbox next to the File_Format dropdown that is labeled "Set transparency index". This should be checked, and the number next to it should be set to the same value as the color index number you have chosen as your transparency in MTPaint's pallette.
I'm sorry, I know that wasn't entirely clear(you should have seen it before I edited it.) When I say "you have chosen" I mean that you have decided to use that particular color(and know its number in the palette.) There is not any way to tell MTPaint which color should be used as transparent before the save dialog box AFAIK.

After saving the file and reloading it, you should see the transparent colored area in your image represented by a dark/light grey checkerboard pattern.

--Lee

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#8 Post by sunburnt »

Thanks fluxit; I noticed that when I converted it to indexed, the olive color changed from 255 to 3.
So I set 3 in the Save As dialog box & the pic. background remained checked or transparent.

Now I just have to figure out how to draw a wide red circle on the USB pic. with a diagonal line through it.
You know... just like the no parking signs (if your in America that is).

The plain one shows for USB insert, & the one with the circle & line on it will show on removal.

User avatar
fluxit
Posts: 326
Joined: Sat 24 Jun 2006, 04:14
Location: Ketchikan, AK USA

#9 Post by fluxit »

Now I just have to figure out how to draw a wide red circle on the USB pic. with a diagonal line through it.
You know... just like the no parking signs (if your in America that is).
This is how I would do it with MTPaint...

First zoom in if you haven't already. It makes working with small sized images much more natural I think. 400, 800 or 1200% work well here for icons.

From the toolbar: Choose a brush. It should be something solid. Circular brushes work well. Make sure it isn't too large.

Choose your color.

From the toolbar: Make selection. Drag the selection box around the area where you want your circle to be.

From the toolbar: Ellipse outline.

For the diagonal cross-bar-

From the toolbar: Straight Line. Left-click the beginning point of the line, Left-click the end. Right-click to finish.

The additions will be jagged of course.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#10 Post by sunburnt »

Thanks again fluxit; It only took me a little while to figure out how to set the foreground color.
Your instructions were great! I now have a .xpm of the orignal pic. & a .xpm with the NO symbol on it.

I've added them to usb-auto, which is nearing completion.
I now have it making SCSI device nodes for extra USBs, thanks to Jesse.
I'm waiting on rarsa to post back about his USB card reader at the other forum post.
If I get that info then I'll have usb-auto working fully, & I'll post it in Additional Software.

can8v
Posts: 586
Joined: Sat 15 Jul 2006, 08:20
Location: Yuba City, CA
Contact:

#11 Post by can8v »

Sunburnt,
Now you have me very curious; what is usb-auto?
-Jason

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#12 Post by sunburnt »

Hi can8v; It's an auto. mounter/unmounter for USB flash pen drives I've been working on.

I'm waiting for a post back to add USB card readers to it, if I can figure out how to do it.

It works well, still under testing, DownLoad it, try it out & let me know how it works for you.

Here's the forum post discussion & download:
http://www.murga.org/~puppy/viewtopic.p ... 1&start=16

Post Reply