Uiactivty image Not Appearing in iOS - ios

I am implementing UIActivtyViewController and I want to add whatsApp image to that. (http://a598.phobos.apple.com/us/r30/Purple/v4/fa/a8/02/faa80212-7d5b-f8a2-0e86-22d619ef6dc2/mzl.cmjuugpr.png) Adusted frame 60x60.
but I am not getting As I excepted, I am getting like following message.
what i have to do display correct image thanks in advance.

You can only play with transparency. Colors are ignored. That's why you are getting a solid rectangle. Documentation says:
The alpha channel of the image is used as a mask to generate the final
image that is presented to the user. Any color data in the image
itself is ignored.

Related

I need to adjust the border of this ios icon

My app icon is showing with white borders, how do I remove it?
this is happening only when I try to build the application for ios, on the android system this does not happen
I tried modifying the alpha channel but it didn't work.
image link: https://imgur.com/IiVoRIj
It looks like your image has some white (or transparant) color on the edges. If that's the case I would open the image in a image program, zoom in, find these spots and fill them with the background color.

Image changes when blurred

Consider the following image.
As you know, WhatsApp shows blurred thumbnails of images in chats until they are downloaded. In this case, when I send the image to others by WhatsApp, the blurred thumbnail looks something like this:
(To reproduce the effect, try sending the original image to a friend and delete the original from Internal Storage/WhatsApp/Media/WhatsApp Images.)
The original and blurred images look completely different. How is this effect achieved?
I have noticed that the original image contains a grid of dots superimposed on it. Is the blurred image formed by those dots? Also, is it possible to merge any two images in this way?
The superimposed image is not blurred. That's another step. But you are right. The second image is in the grid. The abuse the fact that Whatsapp subsamples the image to create a preview.

Toolbar button image suppressed

I have a viewcontroller with a toolbar with 2 bar button items. The image on one is a simple flat icon. The other is a complex image reduced to 28x28 pixels from a 256x256 image. The complex image shows up as a blob as shown below. The actual image is also show in the picture. It is not clear what I am doing wrong. The project code is available in the following link:
Project code
John Griffith on Apple Developer Forum provided this explanation which made a lot of sense. I need to redesign my icons if I want to proceed along this line:
Toolbar images are normally rendering mode "template" - only the alpha channel is used. Any non-transparent pixels are drawn in the bar's tint color. It may be possible to create a UIImage with rendering mode "always original" to preserve the look of your image, but then it won't respond to changes in tint color.
I have downloaded your project. The first thing you should do is to move your image files into the images.xcassets folder. Read here to understand why.
The image you are trying to display is actually just a red rectangle:
As you can see, opening in another program also just displays it as a red rectangle. Be sure to use the correct Image file. The problem lies not with your project but rather the image file you are using.

UIViewContentMode options in Swift

I'm having a bit of trouble understanding and/or implementing images with a particular fill type into my project. The background is a UIImageView. Here is a screenshot of my app's "Profile" page
The image is pulled in from Facebook, using the Facebook graph. The image is a 720x720 square.
The image looks decent in the smaller circle, however the background version doesn't fill the way I would expect it to. Despite having tried all of the "ScaleAspect______" methods, the background looks as shown.
My understanding was that ScaleAspectFill would do what I want, which is the scale the image down until either X or Y is the size of the frame and then crop the remainder out. That's how it's shown on the Apple Docs.
I have added and removed clipsToBounds to the ImageView, neither of which made any changes.
The image I'm working with can be found here:
https://graph.facebook.com/10152976336695409/picture?width=640&height=640
downloaded
EDIT: Clarified that the background is a UIImageView type.

iOS detect color inside UIImage and crop

I'm trying to figure out the best way to approach this. I'm looking to take an UIImage, detect if there are any shapes/blobs of a specific RGB color, find their frame and crop them into their own image. I've seen a few posts of people recommending OpenCV as well as other links similar to this - Link
Here are 2 screenshot's of what I'm looking to do. So in Example 1 there is the light blue rectangle with some text inside it. I need to detect the blue background and crop the image along the black lines. Same for the red image below it. This is just showing that it doesn't matter what's inside of the color blob. Example 2 shows the actual images that will be cropped once the 2 color blobs are found and cropped. All image will always be on a white background.
Example 1
Example 2
This question goes way beyond a simple answer. What you will need to do is access the raw data on that image based on the color then create a frame to crop. I would find the upper, left,right, lower frame of all matches of that specific color then make a frame out of it to crop the image.
Access the color
Get Pixel color of UIImage
Crop the image
Cropping an UIImage

Resources