How to convert image to html?

Is there a way to convert the image to the equivalent of the html image, having an html table divided into many cells, each of which has a specific background color that will act like pixels in the image? Very similar to ASCII art.

I would see this as a way to have a corporate logo in email without worrying about email clients blocking images.

+6
source share
6 answers

Yes, a lot of people have done this: http://pgl.yoyo.org/img2html/ is an example.

+6
source

Perhaps you just need to convert your image to URI format.

 <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO 9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot"> 

http://jsfiddle.net/z6FFc/

+4
source

Try the "Image to HTML Converter for Email" from STYLECampaign. If I remember correctly, you will receive a download link in exchange for subscribing to your newsletter on stylecampaign.com. The tool works fine, has scaling and compression; here's a blog post http://bit.ly/Jhf1CK and a video guide explaining tips and backtrackers: http://www.youtube.com/watch?v=VSi51yLQFnc

+1
source

I would caution against trying such a trick.

A simple rule when you do smart things via email is to ask, β€œDo spammers use the same technique?” If so, you can be sure that ISPs are bundling their filters with junk e-mail containing it.

In the case of spoofing images when displaying either with a base64 trick or with pixels, these methods have been used by spammers for years and can damage your reputation for sending.

If the company has a good relationship with the recipient, they will be happy to display images. Many clients, such as gmail, will include images after you reply or add to your contacts. In addition, using methods such as DKIM to sign your headers, use a reputable third-party sender, or pay for ReturnPath certification can enhance your reputation sufficiently to redefine image blocking at most major Internet providers.

0
source
Tom Walsh, what makes you think that these are always Internet service providers that block images? What about email clients? 80% of email messages have image blocking by default. Relying on users to make an effort or knowledge to change these settings is a bad idea.

Using some services, such as Mailchimp, each time you send, you get a new email address, so you cannot add it as a safe sender. Techniques such as those mentioned are a great way to get a list of email addresses that has already been turned on twice to get a semi-graphic version of your email, to encourage them to upload images.

This top link works. I used JPG, I'm not sure which format it accepts. Just to let you know, this makes the file more believable than regular JPG. Think about whether to use it for large images, but for email, I see that it is a worthy use. I noticed that sometimes when you reply, signatures break ... sooooo .... know that you can get a load of <tr><td>A</td></tr>

Final warning ... if your email signature is broken and ends in code form .... remember that the default for the top link is "ass", therefore ... some customers may find this offensive. Perhaps change it to your company name. And remember that creating a link for this table image will (a) take some time and (b) pretty much inflate this code a second time.

0
source

Try converting to html / css. It is more compact than base64, and although I have not tried it yet, it should work. It uses css to create an image without the need for an external one. Don’t pay attention to the top, this is the place where the code that does all the work. Pay attention to the bottom. https://codepen.io/blazeeboy/pen/bCaLE

 no code. just something I have to do to get the post online. 
-1
source

Source: https://habr.com/ru/post/916631/


All Articles