Page 3 of 3 FirstFirst 123
Results 21 to 28 of 28

Thread: request to convert image to png

  1. #21
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The ideal way to do something like this is to use only black. At the edges should be pixels that are black and partially transparent in a gradient to all transparent. That way it will look smooth at the edges against any color background. The better/finer this gradient is, the more the image can be scaled without losing smoothness. I know The Gimp and other advanced image editors can do that, I'm just not sure how.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  2. #22
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I just forgot to make everything black when I converted the image before. In Photoshop there's no direct way to apply an alpha channel (as far as I know) but you can create a new channel, which by default will be an alpha, then paste the contents of a black and white image into it, thus applying that image as an alpha channel. It took me a while to figure that out the first time I used it, but it works well. I imagine the process in the GIMP is the same.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #23
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    djr33, what you created works great. I like what you made. The image is from one of those weird fonts that are out there. The letter Q in that font looks great as a cross/divider on the http://www.sovgraceopc.org site (A picture of me is on that page. Hint, I am wearing glasses on the top image and wearing a black shirt. I am male.) The Q on that page is bold, but is too much of a pain to get that font to show up in mobile browsers until it occurred to me to detect whether the visitor was using a mobile device by using $_SERVER[HTTP_USER_AGENT] and doing a str_replace of Q with a png image of the budded cross (or imported font letter Q).

    In the first post in this thread in the second EDIT you see the substandard png version I created using a script that I posted later in this thread that creates a png version of any character of a particular font file. The reason it is substandard is that the image is not in the bold format. I have tried creating a script that will create a bold version of the budded cross that we are talking about in this thread, but I can't seem to get it to look quite right, which is why I am am happy with the image you posted.

    If you are looking at http://www.sovgraceopc.org with your mobile browser and wondering why all of the Q's do not look like budded crosses it is because I am lazy and have not finished updating the rest of the site.

    I have almost zero knowledge and experience with graphic design.
    To choose the lesser of two evils is still to choose evil. My personal site

  4. #24
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Ah, thanks for explaining that. I didn't notice the bold difference.

    Well, if you'd like I could redo it with black-- if the white fuzzy border shows up on whatever background you're using. Let me know.

    Graphic design isn't too hard once you start to figure it out. It might take some time, but start playing with it. With free programs like the GIMP it's easier to get into it in the first place, too.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #25
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    The pen tool could work in theory, but it would take a long time and this image already has a built-in alpha channel ready to use.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #26
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    I downloaded The Gimp after learning about it in his thread. It is rather complicated for me, but I am glad to have it. Graphics design is not something I am eager to learn though.

    I don't think there are any built in ways to create a png image of a character using php's GD library, but ImageMagick can, although I am less familiar with it. I want to try it sometime just for fun.
    Last edited by james438; 09-13-2012 at 04:28 PM. Reason: reworded to be more concise.
    To choose the lesser of two evils is still to choose evil. My personal site

  7. #27
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I was able to obtain a very clean image of the character. While viewing the page in Opera I used its Dragonfly to increase the font size to 300px and remove all background and other overlapped elements to white. I did a print screen, pasted to The Gimp, cropped it to the size of the character. It was only 2 colors, black and white. I changed white to alpha and saved. The image could then be resized and any interpolation around its edges was a gradient of semi transparent black pixels. The Gimp is so good at resizing that these regions were thinner than I might have preferred, but adding a little blur can make them wider. The trick would be to add it only to the outer edges, or not. It's pretty good just as is, so I'm leaving that out. To prevent the forum from stepping on the images I'm uploading two in a .zip file. One is the full size, the other slightly smaller which exhibits those regions I mentioned.

    cross.zip
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #28
    Join Date
    Sep 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by djr33 View Post
    Well, inspecting the images closer reveals that there's a white boundary around both of ours. The best solution is to use the image as an alpha channel with the entire image as black. What I did on the first replace resulted in partially transparent grays, to the blackness degree of those grays. What you did was similar, just with a different method.

    However, after all of this, I've looked at James's first post again and I'm confused: the new PNG (from the edit) actually is already on a transparent background. James, is there anything more that should be done from that?
    I flattened each image to demonstrate what I meant. The edge lines are ok in the Alpha example, but for some reason that method left behind artifacts outside of the edge lines. Here are both images with a thin red stroke added on a white background to demonstrate how to check transparency clipping the quick and easy way. Layer blending effectively removes the bits Alpha missed; It also allows the trim function to work correctly, reducing file size in the process. We use this method quite often at work prior to sending crops for printing.

    As mentioned earlier, pen tool cropping would be ideal for the sharpest edge lines, normally the chop line is placed just inside the edge for a seamless transition, and thats how I would tackle the thin white tracing left by blending, alpha, or quick masking methods. Besides, a pen tool vector mask can be scaled without risking degradation to the image, especially handy if you're planning a full DTP kit.

    From post#2 (Alpha)
    Click image for larger version. 

Name:	cross-post2.jpg 
Views:	176 
Size:	26.7 KB 
ID:	4732

    From post#17 (Layer Blending)
    Click image for larger version. 

Name:	cross-post17.jpg 
Views:	185 
Size:	23.9 KB 
ID:	4733
    Last edited by jcvintner; 09-17-2012 at 06:51 PM.

Similar Threads

  1. Replies: 1
    Last Post: 09-26-2009, 02:11 AM
  2. Title to image convert problem !!!
    By winpeace in forum PHP
    Replies: 1
    Last Post: 10-20-2008, 07:04 PM
  3. Convert a html into image
    By Wingel in forum Looking for such a script or service
    Replies: 1
    Last Post: 07-15-2008, 01:34 AM
  4. Replies: 1
    Last Post: 02-11-2008, 03:07 PM
  5. image request
    By *Warrior* in forum Graphics
    Replies: 1
    Last Post: 07-07-2007, 04:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •