24 bit Alpha Channel in Base64_encode - css

So I am experimenting with using icons in my CSS using base64 encoded pngs. I have used http://www.motobit.com/util/base64-decoder-encoder.asp to convert them. However, the pngs only have an 8bit alpha channel, the pixels are either fully opaque, or fully transparent, no partial transparency. This is leaving my icons with hard edges. Any ideas of a 24bit alpha channel is possible through base64_encode?

The encoder in that page may be buggy. I made a PNG with alpha channels in Photoshop, encoded it using PHP's base64_encode(), put it in an image, and it works. Take a look at this fiddle for HTML and this fiddle for CSS.

Related

Convert opacity on text to hex color in sketch

Often I get a sketch file where a designer put the opacity on a colored text. This in itself isn't that awful thing, since I can just use rgba for color on my text in css.
But the problem is that this is a taxing function, and there really is no need for text to be opaque unless there is an image underneath it.
I can use a tool like http://marcodiiga.github.io/rgba-to-rgb-conversion
But I'd like to instruct the designers not to do that in the future. Now, knowing them, they probably won't use the above link, so I was wondering if there is a way in sketch to set the opacity of the text and just 'convert' it to rgb or hex color, depending on the background?
This would make my job a bit faster and easier :)
Is there a functionality like that in sketch?
normally #AARRGGBB is used for hex color with opacity. When you set AA to FF its fully opaque. But in some applications there may be a control that restricts number of digits when you enter hex color (probably there is one and limited to 6).
I didn't find anything easier than using a color picker to sample the value of the rasterized pixel. I use Affinity Designer but there are many other options out there.

What renders faster, pre-defined image alpha, or opacity?

If I have a png image that is 127 alpha, and I have the same image with normal alpha (255) and a CSS style of opacity:0.5, which will render faster?
The reason I'm asking is I want a few partially transparent clouds in a webgame, and I'm interested to know which is a better technique to put less strain on the computer.
PNG will do better.
To render element with opacity < 1.0 the browser will 1) create bitmap buffer, 2) render your image there and then 3) render that buffer to the target.
With PNG it will do just #3.
Particular details may vary but these steps will be there in one form or another.

Can I convert an image to CSS3?

Supposing that I have a polygon image PNG file like this (No border, the shape is filled with one color, no gradient, and background of the image is transparent) http://www.enchantedlearning.com/crafts/books/shapes/gifs/4.GIF
I'm thinking of using that polygon image as a background image and it will be changed (to another image with different color) when the user hovers on it.
But I also want the color of the background image to be customizable. So, I'm thinking if there is any possibility to draw the polygon instead of using image files so that the color will be customizable (I don't think it's a good idea to create one file for one color and so on so forth).
What is the best solution for this case? Using png or drawing it by css?
Is there a tool/website to convert my png to css code?
Make the white areas transparent (colour to alpha in GIMP)
Convert the image to a data URI (it's optional but it will make your site load faster)
Use the url in (2) as the background-image and use any background-color you want.
Use this to convert an image: http://codepen.io/blazeeboy/pen/bCaLE
I think it's much better to use converted images because browsers load them faster.
I think CSS is the wrong thing to use for this. Yes, it is possible to create a lot of shapes using CSS, but there are limitations, and in any case, drawing shapes with CSS is a bit of a hack, even when it's just a simple triangle.
Rather than CSS, I would suggest SVG is the appropriate tools for this job.
SVG is a graphics format for vector graphics that can be embedded in a site, and can be created or altered via Javascript directly within the site. Changing the colour and shape of a simple polygon is about as easy as it gets with SVG.
The other advantage of using SVG is that because it's a vector graphic, it's scalable, so you could display it at any size.
The only down-side of SVG is that it isn't supported by old versions of IE (IE8 and earlier). However, these browsers do support an alternative language called VML, and several good Javascript libraries exist which will work with either, thus allowing you complete cross-browser compatibility. The one I'd recommend is Raphael.js.
So a tiny (and very easy) bit of Javascript code instead of a very messy bit of CSS. Seems like a winner to me.
Maybe u could use this: https://javier.xyz/img2css/, the principle is to use box-shadow,it's fine if the picture is small, so u should consider performance

Paper Texture in CSS?

Is it possible to make this texture in pure css?
See this also for texture: http://dribbble.com/shots/70256-Background-Textures
Assuming that you don't care about supporting older browsers, you can do this:
body {background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAACcCAMAAAAu7ofdAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtlQTFRFbnB2bW94bG50cHJ4bnF6a212cHN8c3V7dXd8c3Z+aGpzdXiAamxyb3F0d3l+bW9yZ2lyd3qCeXuAdnh7aGpwZWdwe32DZ2hteHl9eXyFb3F3bW91cnR6bnB5Y2VtbG53bW93e36HdHZ7bG52bnF5bW92cXN5cXR8dHd/bG51b3J7cnV9foCGb3J6YGNrbXB4dHZ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xzZlRQMCxnPIAnmTRfMqunCGLjVBuQASBQTxEPuj+yUbwR3SJToIhmc9+gBIEOt8gjUT+duQuzTwoqv9opbjW4cElqXzxFZ0q1pDwcCLkfCneTG8csoLGux3I2m3zshrbu9eDi7FGqLFnc/MLu79ttlrHnuLl6BZXXSjbil5C4oIsGJoMtFplekXui20ADi4jCTrMtJ05OwFp8uvKV3gcTY1jC/+J7ZV9QZwR5QAO3jRbrD+Xf19Q907/tTgdfcS9nlpbbTze+Yl6GUf6ABT0mVnH9FdZ0lXjvK01nGu2xPtvKkh77TT15/PDx5ffuRlD08pTdFd/OR9n9yzMZw+8OX3vHXzqY//mf07Mx9yajG6d/Dtz68wliNIdDgDz1YYMDcSHOjGbYcOoa2m+8bjm8YpTxGLtPTefeeC+9/P/MqiikiuWbY1e+303PKg98Bt/VcObJ1g75nZunbQ20/tPbo4x278ZRgI0faTWPCTOrQBW6gbDRe/ju8AQCAsAhQKvLIYfGBn9CjdQ2jnmgTlvkW1NGtmN+b37O5+Kb39HTn9PSe/5x/+zV/70c8DW2/4ZZjUpONfedMF5LqnmxLSivGv2RlBVwMl5BPd4oJ+wWbLKOK2vLVVXjZ/fWWw+MLiDy9Gh3r/6g6+9/773Ozmvn37ps3S/xNgANvv2d/o0uEhAAAAAElFTkSuQmCC')}
It's "pure CSS", right? =D
See: data URI scheme
Edit:
Looking at the comment you left on Evan Mulawski's answer, here is the decoded PNG of my base64 string:
I just copied a portion of the image you provided in your question. It doesn't tile 100% seamlessly, but it looked "good enough" for posting inside a base64 string noone would ever look at.
body {background:url(background.png)}
Depending on how the texture works, you might be able to do it by creating an insanely large number of positioned <div>s with borders in various shades of gray.
Don't.
You can't do that in CSS. You need to make an image and repeat it on the background.
http://vandelaydesign.com/blog/design/photoshop-tutorials-textures/
The best way is to set the background image property using a tiled image.
Filter Forge (filterforge.com) has a filter library. See if you can find a suitable image there, then use repeat-x and repeat-y for a seamless background.

Is it possible to have a transparent photoshop image render in CSS?

Is it possible to have a transparent photoshop image render in CSS? I tried saving as jpg and gif with transparency selected but when I overlay it in css it shows the background color behind it and not the image which is under it. I played with the z-index and it didn't help.
Thanks
JPEG images do not support transparency.
You need to save the image as a PNG file, which does support transparency.
If you need to support IE6, you'll also need to use the filter proeprty.
You need to save it using an image format that supports the type of transparency that you want. The JPEG format doesn't support transparency at all.
There are two types of transparency, transparency index and alpha channel. The GIF and PNG-8 formats support transparency index, i.e. one of the 256 colors are chosen to represent transparency. That means that each pixel in the image can only be either 100% transparent or 100% solid.
The PNG-24 format support alpha channel. That is transparency value for each pixel, so that it can be anything from 100% transparent to 100% solid (in 256 levels).
If your image has mostly fully transparent or fully solid pixels, you can use transparency index, but if it has a lot of partly transparent pixels, you have to use alpha channel.
Note that older versions of IE has problems displaying the transparency in PNG-24 images correctly.
First, have a transparent background (as in no background) as the first layer of your photoshop file.
Be sure it has grey and white squares in the background, which means it is transparent.
When you're ready to save, go to the File Menu, and hit Save for Web
Select the PNG file format and be sure it has "Transparency" checked.
Just press SAVE and give it a name and that photoshop image will be saved into a transparent background PNG file which presents more colors, and it's smaller than a GIF file and is as good as a jpg.
As SLaks pointed out, use a PNG image file for this. JPEG won't do, I am not sure why GIF wouldn't work...
I took a look at a project I was doing involving some translucent background and its CSS, and this is what I found:
background-image: url(../images/translucent_white.png);
So it really is that simple. Just save your picture with transparency as a PNG.
You need to save it as a .png file as mentioned but this is tricky when it comes to IE6. It depends on if the image you have is using a gradient that transistition to the transparency. For instance a shadow.
If you have an image that has a shadow (or any gradient) than you are best off using a .png but this will now work for IE6 and you should follow the advice of SLaks. In my experience though I stay away from javascript fixes like this and just choose to save the image w/ the desired background.
If you do no have a gradient then the .gif is the way to go as it will be supported in all browsers.
I recommend using a .gif filetype; it supports transparent backgrounds and works in most cases. .jpgs don't support transparent backgrounds at all. .pngs support nice alpha-transparent backgrounds, but not in IE6. (Using the AlphaImageLoader filter can cause page slowdown and browser crashes.)
First off, make sure that your image has a transparent background in Photoshop - often a white and grey checkerboard. Then, choose "Save for Web" (or something close to that, it varies in different versions) from the File menu, choose whatever GIF preset works best, and be sure that "Transparency" is checked.

Resources