CSS Font Images - html

another quick question. I've seen this multiple times now in different code sets. Someone calls for an image from the css
HTML:
<i class="icon-map-marker2"></i>
CSS
.icon-map-marker2:before {
content: "\e6f9";
}
Which gives the output of this:
As you can see the picture isn't transparent background. I was looking to edit it to give it transparency, but can't seem to find out how. I've also tried things with the CSS like:
style="background-color:rgba(0, 0, 0, 0.5);"
// Changing the last value's number though and stuff like that
opacity: 1;
// etc
I want to keep the gold color, but have a transparent background! Thanks for the assistance!
An example is on Canvas' live preview - Hover Home -> One Page: http://preview.themeforest.net/item/canvas-the-multipurpose-html5-template/full_screen_preview/9228123?_ga=2.252490057.1116575863.1496646725-686174233.1494200798

Try adding css for a tag for background color:
a{
background:transparent;
}
Background coming form .fbox-icon this div.. just add css for that
.feature-box.fbox-bg.fbox-center .fbox-icon {
background-color:transparent;
}

An option... Download the photo and save it as a png with a transparent BG.
Personally I use Photoshop though there is a free software called Gimp - Free & Open Source Image Editor that will allow you to format transparent photos and then save them as .png.
Typical method involved saving an image locally, editing and
exporting as transparent png.
Right click the hosted photo in your browser and then choose Open Image In New Tab
Right click on the image within the newly opened tab and select Save link as, then choose your destination folder.
Open your image editor software, see my link below for GIMP if needed.
Typically, if you have a good contrast between the BG and the
image or the background is one solid color, as is in your case. You can pull the image out of the background by using the Magic Wand tool.
You can also use the lasso tool to make the selection, where you sort of draw around the selection. However, this method is a bit more tedious and time consuming.
Once you have your image selected apart from the background you wish to remove, simply hit the delete button to delete the selected pixels. *MAKE SURE YOU HAVE THE BACKGROUND SELECTED AND NOT THE IMAGE WHEN YOU DELETE!
Only need feather if you have soft edges, if not skip feathering.
Feather: Feather the selection. Under Select->Modify->Feather. Enter a low number like .5 though you may need to experiment to find the right amount
to feather your softer edges, when needed. Then select the inversion and delete the selected inversion to apply the feather and soften your edge.
Now export your image as a .png file and host it so you can link to the new transparent image.
In PhotoShop, you would choose File->Save For Web Choose PNG-24 and select Transparent
Note the size, preview if needed, then save.
Now re-host within your websites image file structure or online at imgur or other img site and link to the newly posted
transparent pic.

Related

how to get the same font effect in photoshop image

I am really new at photoshop and I created some some effect on text few days back now I Want to get the same effect and apply it again in different image
It's basically a date and now I want to modify it but I need same effect
Here is the image that I created
I now want to edit it to todays date but I don't remember how I did.. Please help me people..
Double click on the layer containing the text to get the layer style window.
There you will find a "Drop Shadow" option than you need to click and check. The settings that I would guess for the image you posted are
Distance: 0
Spread and Size vary depending on the size of your text
You can save the layer style by clicking "New style" in the layer style window. This will allow you to re-use the same settings.
To use a saved layer style go to Styles in the layer style window and choose from the styles list.

How to choose a color on a palette to change part of an image?

I don't even know where to begin or what codes will be needed.
I'm trying to build a website that allows the user to change a certain part of an image's color. Just like a coloring book page online, where someone can choose a color from the palette and it will allow them to click on that part of the image to change it to that color. Once they are done they can save the image to their computer.
Any help in the right direction would be incredible!
You can try to make a transparent div over a div containing the image which is in absolute position of the div containing the image.
Then you can check some javascript plugin to get a color picker plugin.
With Javascript and for example jQuery, you can add some events on click on the color picker and then on click of the div which is hover the image to apply the picked color.
I hope this is clear for you, otherwise I can make a JSfiddle

How do you auto fit an image on a button so that you don't have to stretch the button to show the picture in Access 2010?

I'm building an access database for my music catalog. I've created one main table with a bunch of queries. I want to make a decent looking front end. I have a bunch of buttons with macros assigned to them already. The problem (which I presume is something very small that I'm missing) is that I added a picture to the button it's just a picture of vinyls that would run a query to show my vinyls. The picture only displays a portion rather than the whole picture. I can get it to show the picture by expanding the button size but this is not desired.
Any help is appreciated.
Thank you and Happy Thanksgiving.
The button doesn't resize the image you assign to it.
You first need to resize your picture files to whatever size you deem suitable for the button, then use that scaled down image.
Alternatively, you can use the Image control instead of a button. That control will allow you to resize the image inside it, but it will generally appear slightly blurry, depending on the image and the dimensions you resize it to.
Also, forcing Access to load larger image and then resize them can make your application less responsive if you have a lot of images, since you make it do extra work.
A workaround is to work with an image and a button.
Insert and size the image you need in the form
Add a button, setting its property "transparent" to true
Overlay the transparent buton over the image
Make sure the button is on the topmost layer usuing the "bring forward" in the image menu. We have then the transparent button over the picture
Associate VBA code or macro to transparent button.
For all intent and purposes, user will click on an image, but because there is a transparent button over it, will be in fact clicking on the button

Protect image download

I know the best way to protect image download is not putting it on internet in the first place.
I assume there is no 100% protection against image download and that if a user can see an image on internet he can with a bit of experience find access to download it.
I am aware of transparent .gif or .png covering the images or using background_image CSS property to protect it and prevent right click download but are there
other ways to complicate image download and therefore prevent image download by most users?
Here is simple code to start with :
<img src="http://placekitten.com/600/450">
Another way to remove the "save image" context menu is to use
some CSS. This also leaves the rest of the context-menu intact.
img {
pointer-events: none;
}
It makes all img elements non-reactive to any mouse events such as dragging, hovering, clicking etc.
See spec for more info.
In reactjs project, avobe code put in global CSS (index.css)
No there actually is no way to prevent a user from doing a particular task. But you can always take measures! The image sharing websites have a huge team of developers working day and night to create such an algorithm where you prevent user from saving the image files.
First way
Try this:
$('img').mousedown(function (e) {
if(e.button == 2) { // right click
return false; // do nothing!
}
});
So the user won't be able to click on the Save Image As... option from the menu and in turn he won't get a chance to save the image.
Second way
Other way is to use background-image. This way, the user won't be able to right click and Save the Image As... But he can still see the resources in the Inspector.
Third way
Even I am new to this one, few days ago I was surfing Flickr when I tried to right click, it did not let me do a thing. Which in turn was the first method that I provided you with. Then I tried to go and see the inspector, there I found nothing. Why? Since they were using background-image and at the same time they were using data:imagesource as its location.
Which was amazing for me too. You can precvent user from saving image files this way easily.
It is known as Data URI Scheme: http://en.wikipedia.org/wiki/Data_URI_scheme
Note
Please remember brother, when you're letting a user surf your website you're giving him READ permissions on the server side so he can read all the files without any problem. The same is the issue with image files. He can read the image files, and then he can easily save them. He downloads the images on the first place when he is surfing your website. So there is not an issue for him to save them on his disk.
If it is only image then JavaScript is not really necessary. Try using this in your html file :
<img src="sample-img-15.jpg" alt="#" height="24" width="100" onContextMenu="return false;" />
There is no way to protect image downloading. This is because the image has to be downloaded by the browser for it to be seen by the user. There are tricks (like the transparent background you specified) to restrict certain operations like image right click and saving to browser cache folder, but there isn't a way for truly protecting the images.
1. Disable the Right Click on all Images
let allImages = document.querySelectorAll("img");
allImages.forEach((value)=>{
value.oncontextmenu = (e)=>{
e.preventDefault();
}
})
2. Disable the Pointer Event Using CSS
img{
pointer-events: none;
}
3. Put a transparent overlay over all the Images
<div class="imageContainer">
<div class="overlayDiv"></div>
<img src="Image.jpg" alt="Image">
</div>
And some CSS like this
.imageContainer{
position: relative;
}
img{
position: absolute;
width: 100%;
height: auto;
top: 0px;
left: 0px;
}
.overlayDiv{
position: absolute;
width: 100%;
height: auto;
top: 0px;
left: 0px;
background-color: transparent;
z-index: 2;
}
4. Put your Image as a Background Image
div{
background-image: url(Image.jpg);
background-size: cover;
}
These methods will only work on normal users because they most probably don't know about the inspector or how to check source code.
But a web developer can easily download these files, there is no such way you can disable the inspector completely.
At the end i would like to add few words.
Technically, Now think about this you are sending a Image from your server to another computer over HTTP, and you are at the same time trying to prevent it, it doesn't make any sense.....
you should always assume that anything that enters the machine of the user can be retrieved back now or later, no matter how hard you try, to hide it with encryption or maybe like youtube, sending the thing in chunks, and collecting them in browser.
getting the image ultimately is hard for a common user but not for people with a lot of technical background, maybe they are intercepting the entire network on Operating System Level, how you gonna stop them there.
As some people already said that it is not possible to prevent people to download your pictures, a trick could be something like this:
$(document).ready(function()
{
$('img').bind('contextmenu', function(e){
return false;
});
});
This trick prevents from the right click on all img. Obviously people can open the source code and download the images using links in your source code.
There is no full-proof method to prevent your images being downloaded/stolen.
But, some solutions like: watermarking your images(from client side or server side), implement a background image, disable/prevent right clicks, slice images into small pieces and then present as a complete image to browser, you can also use flash to show images.
Personally, recommended methods are: Watermarking and flash. But it is a difficult and almost impossible mission to accomplish. As long as user is able to "see" that image, means they take "screenshot" to steal the image.
Here are a few ways to protect the images on your website.
1. Put a transparent layer or a low opaque mask over image
Usually source of the image is open to public on each webpage. So the real image is beneath this mask and become unreachable. Make sure that the mask image should be the same size as the original image.
<body>
<div style="background-image: url(real_background_image.jpg);">
<img src="transparent_image.gif" style="height:300px;width:250px" />
</div>
</body>
2. Break the image into small units using script
Super simple image tiles script is used to do this operation. The script will break the real image into pieces and hide the real image as watermarked. This is a very useful and effective method for protecting images but it will increase the request to server to load each image tiles.
First realise that you will never be able to completely stop an image being downloaded because if the user is viewing the image they have already downloaded it (temporarily) on their browser.
Also bear in mind the majority of users will probably not be web developers but they may still examine the source code.
I really discourage disabling right click, this can be extremely frustrating for the end user and is not safe anyway since the image can still be dragged into a new window and downloaded.
I would suggest the method used by CampSafari i.e.
img {
pointer-events: none;
}
but with an improvement:
So first lets remove the url of your image and add an id attributes to it. Like so:
<img id="cutekitten">
Next we need to add some JavaScript to actually show the image. Keep this well away from the <img> tag you are trying to protect:
document.getElementById("cutekitten").src = "http://placekitten.com/600/450";
Now we need to use the CSS:
#cutekitten {
pointer-events: none;
}
The image cannot be dragged into a new window as well downloaded via right click.
JSFiddle
Yet another method you could use is the embed tag:
<embed src="http://placekitten.com/600/450"></embed>
This will prevent the right click.
I know this question is quite old, but I have not seen this solution here before:
If you rewrite the <body> tag to.
<body oncontextmenu="return false;">
you can prevent the right click without using "real" javascript.
However, you can't prevent keyboard shortcuts with HTML. For this, you must use Javascript.
As other answers said, if you can see it you can copy/download it.
To add up to the other answers, just for your information, you can add invisible or tricky watermarks to your images:
http://www.cgrats.com/create-an-invisible-watermark-in-photoshop.html (just an example, there are more techniques, just google for invisible watermarks)
Anyway if you want to prove the ownership of your image a good way is to have a bigger resolution copy for yourself, and always publish a lower resolution / size one. Or publish it also on a "public" media like ... deviantart or flickr or something where people can't change the upload date. This way you can prove you had that image before anybody else
Try this one-
<script>
(function($){
$(document).on('contextmenu', 'img', function() {
return false;
})
})(jQuery);
</script>
This is working form me: content: url('https://myimage.png'); in the style or css class. Than you cant right click and save the image.
img.my-image-class{
content: url('https://myimage.png');
}
You can also convert the image to base64 and put it like bellow. So if yo want to download the image you need to use developer tools, than find the class, than copy the base64 which can be long if the image is big and than you need to decode this base64 and you will have the image. So its still possible to download the image. Even if it was not possible users can make screenshots of the image on the webpage and cut it in paint or use cutting tools.
img.my-image-class{
content: url(data:image/gif;base64,...img base64.....);
}
Convert IMG to Base64: https://www.base64-image.de/
Decode Base64: https://codebeautify.org/base64-to-image-converter
Reference: How to reuse base64 image repeatedly in HTML file
It's pretty much all about how much work the "thief" is willing to put into stealing the image.
You can possible deter a lot of lazy ones by just disabling the right-click menu, creating overlays, using it as background-image, ... But anyone with limited IT skills can go into the Developer Tools, under "Network", and is able to see and copy any images that have been downloaded to the browser.
These solutions also come with some downsides. Using "background-image" will possibly prevent Google from indexing your image. No context menu can prevent the user from using other options in the context menu which can be quite annoying.
The best - and basically only - solution, is to cut the image up into small pieces server-side, and put them back together with some custom javascript. For extra protection you can store some kind of "map" along with the image, with directions on how the image should go back together. This way it's not clear to the thief how all the different downloaded tiles should fit together.
Of course anyone can always take a screenshot. But I assume you are more worried about people downloading a full size and high quality image, instead of just having a low-res screenshot version.
As we know there is no proper method to avoid image theft. But we can reduce it for some extent. We can avoid those people who are not geek in computers to download the image as well as your code.
Here are some JQuery tricks we should include in our site to reduce image theft
Disable right click
Disable Ctrl+ combination (ex Ctrl+s,Ctrl+u) [Better to disable Ctrl key ]
But user can also download the web page using developer tools in Firefox. We don't have solution for this because this will be on the client side and is provided by the user's browser.
You can find the code for all the above listed on stack overflow
this code will disable Right-Click on Win or Click and hold on mac to open "contextmenu"
$("img").on("contextmenu",function(e){return false;});
It's so simple and always works fine.
and it's not depends on OS or Browser that you're using.
I used the below code in global CSS (index.css) in ReactJS. It's working correctly. You can also try. Thanks.
img{
pointer-events: none;
}

Transparent PNG menu item backgrounds in IE6 with rollovers

Hi I have been trying to do this for what feels like all my life
I have a list menu with block display links, each link has a sliding doors png background image. I have used this javascript (http://www.ideashower.com/our_solutions/png-hover/) to implement the alphaimageloader fix for ie6 using a transparent gif.
When I test it for the first time it works but if I click to a different page and then click back it doesn't work anymore - the menu completely disappears, I can get it to work again by duplicating the transparent gif and changing it's name, but again if I go to another page and then come back to it, it stops working and the menu dissappears.
Is this a server caching issue or something like that.
Any thoughts on this would be much appreciated!
Thanks
If its caching then maybe the AJAX trick could do.
Create random number each time the code is executed and add it to the transparent gif url.
so in file pngHover.js:
transparentImage =
'/j/transparent.gif';
would be
transparentImage = '/j/transparent.gif?143253214';
To get random number in js google it, it will give you plenty./