Working with Images in Xamarin App programmig - xamarin

I am working on a Xamarin App compatible with all devices. I have a general question related to images. I am using Location Mark Image Icons to provide locations available on the Map. My issue is, Image has a white background which is also showing along with its background. I want to show only the Image.
Is this related to the designer to provide the image without background? Or as a developer, I can do something on it.

Xamarin.Forms doesn't delete your white background. What you need to do is following a small tutorial on how to use Adobe Photoshop for example and export your images as png, you might even consider which png type you need, there's 3 types of png:
png8
png24
png32
I won't be going deep in explaining each one of them, but you need to know that they all support transparency and could have a transparent background, however, you might notice some differences between them on the edges.
For example, png8 will give a small white border while png24 will not show that.
You can check this for example: https://helpx.adobe.com/photoshop-elements/using/optimizing-images-png-24-format.html

No, you can't do anything about it using Xamarin.Forms. You need to modify the image and remove the background (using Adobe Photoshop, etc.) and make sure to save it as .png.

If its simple white background you want to remove, You can utilise simple [MakeTransparent][1] method ofBitMap.
But this will remove all white coloured pixel. So IF your logo also contains white color, better you contact your designer.

Related

Is it possible to use an image icon that is opaque?

I'm using an cartoonish icons for system users and I noticed that when the background is transparent in the file, it gets ugly black in CRM on the form. So I made it obliquely white, which resolved the problem half way through. The other half is that the sucker looks as the image below shows.
Can it be resolved somehow or do I just need to get used to it and live with it?
Dynamics CRM doesn't support transparent PNGs for the entityimage field.
The ugly alternative is to use the bar color (#002050) as background of your images.
EDIT: in case you want to have fun with the entityimage field and a webcam, check my tool
Dynamics CRM Mug Shot

Picture Transparency

How do I make a picture transparent in VB6.0 so that when I add image and put the picture, the background will show behind it?
From Rod Stephen's excellent VB Helper site (particularly good on graphics in VB6):
HowTo: Overlay one image on another with a transparent color by using PSet
Description from the site:
This program simply loops through the pixels in the images. For each
image in top-to-bottom order, the program looks for a color other than
the one defined as transparent. When it finds such a color, it stops
looking at the images and sets the output pixel's color using PSet.
Note that there are faster ways to access color values in V 6 and VB
.NET, and that there are faster methods for merging images if you have
an overlay mask. Note also that VB .NET provides tools for setting a
transparent color for an image so this problem is trivial in VB .NET.
i think you should use an ocx and dll library to fix it
You can use 3rd party .ocx files to get that effect.checkout this link http://www.vbforums.com/showthread.php?636390-vb6-Transparent-PictureBox

Drawing large images for ipad

I am developing an application for viewing images.
I used the example of PhotoScroller Apple to implement this application.
In my application I want to be able to draw on the image.
I had the idea to put a UIView on top with transparent background and draw the lines via touch events. This solution has become very slow because the generated images are very large, around 3700x2000 pixels.
I also tried a solution with the example of Apple GLPaint that uses OpenGL, but it has a size limitation of 2048x2048 pixels.
Anyone have any idea or example of how I implement this?
I think you should try and tile your image.
One option is using CATiledLayer. Have a look at this short tutorial.
Or you could try and use CGContextDrawTiledImage to get your stuff done. Possibly this post from S.O. could help you getting started.

Magento Image processing extension

Is there any extension which is specifically goes for fill image color like module. I have 1000's of images which all same size but have white space around all image, instead of using photoshop can i use PHP to process that image to have different(brown color - sine it is background) instead of white. If there is any extension please suggest me.
Thanks in advance
If you want to have same background for all images,you can override the magento class that applies background color.
File is app/code/core/Mage/Catalog/Model/Product/Image.php
Find the code that looks like this protected $_backgroundColor = array(255, 255, 255); and specify the RGB value of the colour that you want.
Check out ImageMagick. I haven't used it for exactly what you are trying to do, but I have used it for other kinds of batch image processing. It can be ran from the commandline, but also has APIs for several programming languages.
For what you are trying to do, I'd take a look at the -fill, -floodfill, and -fuzz options.
http://www.imagemagick.org/script/command-line-options.php#fill
I got solution for my problem by the following method.
<?php
echo $this->helper('catalog/image')->init($_product, 'image')
->constrainOnly(TRUE)
->keepAspectRatio(TRUE)
->keepFrame(FALSE)
->resize(600,null)
?>
I got it from here.
http://blog.chapagain.com.np/magento-resize-image/
You should consider getting rid of that white space unless you have other reason for it, e.g. to have product images to scale.
This is best achieved with Photoshop if you have got it, if the white is absolutely, definitely white then you can take the top-left pixel and crop from that.
Another option you may wish to consider is using png images, again this depends on your images and skill in Photoshop, however, you can use transparency in png and have no border on your images.
Also, in photoshop or imagemagick you may want to consider making your own thumbnail images, separate to the product page image. This will enable you to apply filters such as sharpen to get product page images that are a cut above your competitors.
As noted by #jmspldnl you can use imagemagick on the command line as well as php extension. On the command line you can work out the process and string together lots of steps, when happy with your options, rather than re-work it in php code you can use 'passthru()' and run what you worked out from the command line.
For going forward you can put a cron job that monitors your images folder and processes and images that have been changed/added in the last day. This will make it easier to just upload images and have your system do the work.

Find logo in desktop screenshot

I need to develop a desktop application which will
1.) have a list of the Different Application logos (Background Transparent) e.g. IE, FIREFOX, CHROME, PHOTOSHOP ETC.
2.) User will take a screenshot of desktop and save the image.
3.) Now my application need to search all the logos in the screenshot image and tell which all logos are present and where.
4.) I used OPENCV, it's working, but when user changes the desktop background & captures screenshot, it's not working as the transparent area of logo is getting the desktop background content.
Can somebody provide a solution or libraries open source, commercial to do this job.
This is easy to do using cross-correlation.
See my answer to this question.
Basically:
Start with desktop image and one template image for each icon
Apply edge detection (e.g. Sobel) to the desktop image and template images.
Throw away the original desktop image and templates, you won't need them anymore cause we'll be using the edge-detected images
For each template
Do template matching as you normally would
Threshold the maximum of the result. If it's above the threshold, you have a match at that position. Otherwise, no match.
If your icons are aligned in a grid on the desktop, you may be able to speed up your processing by only checking those specific grid positions.
EDIT
You can also save a lot of time by knowing which icons to search for. If you have access to the file system, then just look for *.lnk files (or any other extensions you may be interested in) in the directory that corresponds to the desktop (can't remember exactly what it is, but for Windows7 it's something like c:\users\misha\desktop). That will tell you what icons are there on the desktop. This will allow you to shorten your template candidate list before you go and do the template matching.
I like misha's answer and I think it should work for you. But it that doesn't work you could try replacing the transparant pixels in your reference logo with uniformly distributed random noise before trying the match. This will make the transparant pixels irrelevant for any matching computation because they will match just as bad no matter what there is on the desktop in those pixels.
I'm not familiar with the tools you're using, but I'm guessing you have to either:
a) Tell your program to ignore transparent pixels in the icon images during the comparison operation.
OR
b) Tell your program to treat transparent pixels in the icon images as "wildcards" which can be any color.

Resources