PHP Classes

Transparency

Recommend this page to a friend!

      floIcon  >  All threads  >  Transparency  >  (Un) Subscribe thread alerts  
Subject:Transparency
Summary:Error when transparency = true
Messages:13
Author:Jason Brook
Date:2010-03-11 21:26:44
Update:2010-03-15 20:49:52
 
  1 - 10   11 - 13  

  1. Transparency   Reply   Report abuse  
Picture of Jason Brook Jason Brook - 2010-03-11 21:26:44
When i set transparency to true the white around the edge is removed just fine (i say fine its very gagged and needs a way to be cleaned up). But inside the image any white is also removed is there a way i can stop this, and also hopefully tidy up the edges.

I really would appreciate the help thanks.

  2. Re: Transparency   Reply   Report abuse  
Picture of Joshua hatfield Joshua hatfield - 2010-03-12 13:24:30 - In reply to message 1 from Jason Brook
Could you link me to a copy to the image so I can run this and see what exactly is taking place?

  3. Re: Transparency   Reply   Report abuse  
Picture of Joshua hatfield Joshua hatfield - 2010-03-12 13:34:53 - In reply to message 1 from Jason Brook
You know, I reviewed the code because I couldn't think of any functions in floIcon where you "set transparency" and I still don't see one. You should set transparency in whatever program you use to create the original image (i.e. Photoshop, Paint Shop Pro, GIMP, etc). Then, floIcon will automatically detect transparency (alpha transparency forces 32 bit storage, 257+ colors force 24 bit storage, etc.) when you add the image with addImage().

Let me know if any of this information helps and/or please provide me with any additional information that can be used to help you with your problem.

  4. Re: Transparency   Reply   Report abuse  
Picture of Jason Brook Jason Brook - 2010-03-12 14:20:18 - In reply to message 3 from Joshua hatfield
That would be why then i am taking in an ico file that doesnt support transparency and then using that to output a png file with the white areas as transparent.

I cant at the moment actually give a link to the file as the site is behind password protection. However if you think there is still a way to make the transparency work then i will setup another area on one of my other sites and link you to that.

  5. Re: Transparency   Reply   Report abuse  
Picture of Joshua hatfield Joshua hatfield - 2010-03-12 14:58:43 - In reply to message 4 from Jason Brook
So the source is an icon file, and you're extracting an image in the icon file that has no transparency and adding transparency to it by setting the gd transparency palette entry to white?

If this is correct, you should know that adding transparency in a visually appealing way to an image that does not have transparency (which seems what you want to do) is outside the scope of floIcon. It's scope is to take images and do a simple conversion from one type to another (ico => gd resource, gd resource => ico).

If you are trying to automate the process of adding transparency in a visually appealing way, floIcon is not going to be of assistance. I don't know of a class that does this, but I have not looked. Judging from the capability of professional imaging software (which require a decent amount of human interaction to properly do this task), I doubt this can be done well automatically.

I personally would suggest exporting the individual images as PNGs (you can do that here: http://blog.flobi.com/test/floIcon/ if you like or use floIcon to write your own page to do it) opening them individually in a graphics program (i.e. Photoshop, etc.), making the transparency as you desire, and import them back into the icon file.

I hope this information is helpful, and if I have misinterpreted your desires, please correct me.

  6. Re: Transparency   Reply   Report abuse  
Picture of Jason Brook Jason Brook - 2010-03-12 22:40:25 - In reply to message 5 from Joshua hatfield
That helped me greatly. At the moment its not such a big deal and tyhis does what i need on most counts. I will have a look around and see what i can find out to use in the future.

Thanks so much and nice work on the class.

  7. Re: Transparency   Reply   Report abuse  
Picture of Jason Brook Jason Brook - 2010-03-13 11:59:09 - In reply to message 6 from Jason Brook
Sorry for bothering you again but i was wondering on your site, i think its your site at this address: http://blog.flobi.com/test/floIcon/

That is what i want to do with the favicon part only at the bottom essentially i have written a script that finds the favicon on the site. I want to be able to do exactly what your script does there and load a png image back that is the same size and is transparent background however in this example that i made the image comes back totally wrong, all squashed and everything.

nquri.com/nt/favs/?u=facebook.com

Im not sure whats wrong with it loading the images, as some work and some are crushed and some are the wrong colours.

Any help would be great thanks.


  8. Re: Transparency   Reply   Report abuse  
Picture of Joshua hatfield Joshua hatfield - 2010-03-13 19:37:19 - In reply to message 7 from Jason Brook
Are you using the newest version (1.1.1)? I was looking through the revisions and some of the older ones had trouble with some images. The current version is what is on http://blog.flobi.com/test/floIcon/ and it's not having a problem with the facebook image. I'm not sure what else to say unless you have more information for me.

  9. Re: Transparency   Reply   Report abuse  
Picture of Jason Brook Jason Brook - 2010-03-13 20:16:40 - In reply to message 8 from Joshua hatfield
That would be why i have version 0.1 no idea why i have that version i downloaded it only a few days ago i have the new one now, could you explain how i could do the favicon part of your script.

Thank you so much for all the help i really appreciate it.

  10. Re: Transparency   Reply   Report abuse  
Picture of Joshua hatfield Joshua hatfield - 2010-03-14 21:42:07 - In reply to message 9 from Jason Brook
I'm curious where you got that. The only place I've authorized for distribution is phpclasses.org and I can't find the older versions on here.

I'm glad that took care of your issue. I'd seen icon issues like that when I had some mathematic issues parsing the bits in the ico file.

As far as getting the favicon from a site, I just use file_get_contents() to download it and try the normal locations which are /favicon.ico and favicon.ico in the current folder. Also, checking the meta tags for a ref to the file. I could copy/paste you the code when I get to a computer, but I can't really do that from my iPhone.

 
  1 - 10   11 - 13