unidox Posted September 15, 2007 Share Posted September 15, 2007 I have an image .gif, with text in it, but I want there to be no text, and echo the text in php. Like say I have a .gif and it says Hello. I want to remove the Hello, so its just the bg. But the bg into a table, and echo out the text with correct font. The font is Bebas, so everyone might not have it. How can I do this? Quote Link to comment https://forums.phpfreaks.com/topic/69510-echo-text/ Share on other sites More sharing options...
rarebit Posted September 15, 2007 Share Posted September 15, 2007 You seriouslywant to remove text from an image... with great difficulty! Unless your putting it on, then obviously don't. As for the font you can get CSS to download it, , it goes something like this: @font-face { font-family: Garmond; src: url(Garmond.eot); } Quote Link to comment https://forums.phpfreaks.com/topic/69510-echo-text/#findComment-349268 Share on other sites More sharing options...
unidox Posted September 15, 2007 Author Share Posted September 15, 2007 Yea, it works, but its all jagged. I used smooth in photoshop. How do I do that in css? Quote Link to comment https://forums.phpfreaks.com/topic/69510-echo-text/#findComment-349284 Share on other sites More sharing options...
rarebit Posted September 15, 2007 Share Posted September 15, 2007 Removing text from an image is too hard. First you'd need an algorithm to identify which pixel regions are part of the font and then what you'd like to replace them with (e.g. to match the background)... The CSS shown above will download a locally stored font named garmond, you'll need to find some web fonts, i've never bothered! Quote Link to comment https://forums.phpfreaks.com/topic/69510-echo-text/#findComment-349285 Share on other sites More sharing options...
unidox Posted September 16, 2007 Author Share Posted September 16, 2007 No, what I have right now is a psd with a background and a text layer(Custom Bebas Font). WHat I want is to in a table use the psd background as the table bg, and echo the text with correct font. How do I do that? Quote Link to comment https://forums.phpfreaks.com/topic/69510-echo-text/#findComment-349360 Share on other sites More sharing options...
Crew-Portal Posted September 16, 2007 Share Posted September 16, 2007 Wait wait wait... Are you saying that you want to use php to remove text from an image? Wow now thats going to take alot of coding. Better bet is to just use phooshop and try to make the image look good! When it comes to images sometimes humans are smarter than php, But not always! lol jk Quote Link to comment https://forums.phpfreaks.com/topic/69510-echo-text/#findComment-349370 Share on other sites More sharing options...
unidox Posted September 16, 2007 Author Share Posted September 16, 2007 NO!@ I have the bg in a gif, with no text, but now I want to use the custom Bebas font in a table. Quote Link to comment https://forums.phpfreaks.com/topic/69510-echo-text/#findComment-349376 Share on other sites More sharing options...
Crew-Portal Posted September 16, 2007 Share Posted September 16, 2007 Okay thank goodness. I thought you were going crazy trying to take text outta images with php. You should try using ImageCreateFromJPG(); ImageDestroy(); I use these functions all the time for messing around with images in PHP, it can add text add text from user input, change bg colors, adjust tint and ect ect...! Quote Link to comment https://forums.phpfreaks.com/topic/69510-echo-text/#findComment-349379 Share on other sites More sharing options...
unidox Posted September 16, 2007 Author Share Posted September 16, 2007 So whats the script to do that? Quote Link to comment https://forums.phpfreaks.com/topic/69510-echo-text/#findComment-349383 Share on other sites More sharing options...
Crew-Portal Posted September 16, 2007 Share Posted September 16, 2007 Search PHP.net it requires you to enter your quardenets in Pixels of where you want your text to start and end, Where you want your text positioned, what font, create image or use existing and alot of stuff. http://ca.php.net/manual/en/function.imagecreate.php Thats a direct, its hard to explain cause there are so many factors. its like showing someone how to website. There are so many factors at play that you cant really teach them without writing 1000 lines of text. But luckily php.net has 10000 lines of text so I dont gotta type it. Check it out there! Quote Link to comment https://forums.phpfreaks.com/topic/69510-echo-text/#findComment-349388 Share on other sites More sharing options...
unidox Posted September 16, 2007 Author Share Posted September 16, 2007 Well, I got it to echo properly. But in ps I used the smooth option. How do I set that in css? Quote Link to comment https://forums.phpfreaks.com/topic/69510-echo-text/#findComment-349410 Share on other sites More sharing options...
Jessica Posted September 16, 2007 Share Posted September 16, 2007 there isn't one. You can use anti-aliasing in PHP's image functions Quote Link to comment https://forums.phpfreaks.com/topic/69510-echo-text/#findComment-349411 Share on other sites More sharing options...
rarebit Posted September 16, 2007 Share Posted September 16, 2007 What format is your font? For GD (via php) will need to be in *.gdf format. For CSS to use it, it will need to be in *.eot format, these are not easy to get (for IE see WEFT and for NETSCAPE see www.truedoc.com). Quote Link to comment https://forums.phpfreaks.com/topic/69510-echo-text/#findComment-349474 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.