Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: request to convert image to png

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

    Default

    Thanks for posting the graphics editors that you use jscheuer1. I recently downloaded The Gimp and am playing around with it.
    To choose the lesser of two evils is still to choose evil. My personal site

  2. #12
    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 don't see it as any real variation. It's just the way the scale is represented. Remember it's a double edged scale. As resolution increases, compression decreases. So it's just a matter of which (resolution or compression) is represented by the number. Unless you mean some with 1 - 99, others with 1 - 100. I think that might be indicative of one or both of:

    1. 99% is the highest quality you can expect form JPEG which is never 100% lossless. Programs that include 100% are lying to you.

    2. In the JPEG format the scale is divisible into any reasonable number of equal and/or unequal increments.



    Unless james438 uploads the original image to a server and gives us a link to it there, we cannot be 100% sure we are seeing the original.

    I suspect though that the minor artifacts in the image are due to how it was first created, rather than conversion to JPEG. But that's only a suspicion. I could easily be wrong about that.
    - John
    ________________________

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

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

    Default

    He did link to the original, and I've compared them both-- there's nothing to worry about in this case (even though that's not usually true).
    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

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

    Default

    Code:
    <?php
     $im = imagecreatetruecolor(330, 400);
     $bg = imagecolorallocate($im, 0, 0, 5);
     $black = imagecolorallocate($im, 0, 0, 0);
     imagefill($im, 0, 0, 5);
     $text='Q';
     $font = 'include/fonts/tt9832l.ttf';
     imagettftext($im, 300, 0, 10, 320, $black, $font, $text);
     imagecolortransparent($im, $bg);
     header('Content-type: image/png');
     imagepng($im);
     imagedestroy($im);
     ?>
    The above is kinda cool because it takes a character of a particular letter of a given .ttf font file and outputs it as an image with a transparent background using php's GD library.

    You can see a larger version of the image of the letter Q here. Actually, the image in the first post was the bold version. I am still working out how to do that.

    Line 2: $im = imagecreatetruecolor(330, 400);
    //changes the size of the box.

    Line 8: imagettftext($im, 300, 0, 10, 320, $black, $font, $text);
    //300 is the font size. 10 is the offset from the leftmost side of the box. 320 is the baseline of the font, not the bottommost location of the letter.

    If you are curious the font I posted above is holiday pi regular. You can also download it legally for free here. I believe it also comes bundled with various microsoft products like Microsoft Office or Microsoft Publisher so you may want to check around first before buying.
    Last edited by james438; 09-10-2012 at 05:41 PM. Reason: added links to holiday font, updated script
    To choose the lesser of two evils is still to choose evil. My personal site

  5. #15
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    I thought the point of fonts was being able to read them
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

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

    Default

    To create a bold version of the letter you just draw the image 9 times in each of the 9 quadrants. The 8 quadrants that are not the center one are off center by 2px depending on the size of the image and the level of boldness you are going for.

    bernie1227, I think fonts like the one I am working with are designed to store icons of a particular theme like Halloween or hand signals.
    To choose the lesser of two evils is still to choose evil. My personal site

  7. #17
    Join Date
    Sep 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by james438 View Post
    I want to convert this image into png format with a black cross with a transparent background. I'm hoping someone might be interested. I don't have the means or know how to do this.
    In Photoshop you can import this image, and since you currently have highly contrasting content, it makes it really easy to use layer blending. Export to PNG 24 with transparency and negate the matting (unless you'd like to blend it more with the background using a mat color). I brought the blending to 184 on the Gray channel for this example to maintain the smooth edges, hope it helps. A smudge of gray remains for smoothness otherwise the image starts losing its edge.

    Click image for larger version. 

Name:	cross.png 
Views:	166 
Size:	13.0 KB 
ID:	4727
    Last edited by jcvintner; 09-12-2012 at 02:52 PM.

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

    Default

    That can approximate it, but the best results are by using the image itself as an alpha channel. That's what I did for the image in the first reply in this thread.
    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

  9. #19
    Join Date
    Sep 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Except through the Alpha, in your example, we end up with artifacts beyond the edge lines of the image, which you can see by applying a dark backdrop. One way to check this is to add a contrasting stroke to your edge if you'd prefer not to add a dark test layer.

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

    Default

    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?
    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

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
  •