How to write a lightroom plugin which sets the crop of all selected images? - plugins

I wonder if it is possible to write a lightroom plugin, which applies crop rectangles to a set of images?
Of course I do not just want to duplicate the crop, I'd like to set a different crop to every image, based on some computations.
Can this be achieved with lightroom plugins, or would I need to try a different approach?

Unfortunately as of Lightroom SDK 3.0 it is not possible to programmatically crop an image. There is no official reason for this, but it seems to stem from a two linked causes. First, the only way to change an image is to use LrDevelopPreset. This class allows a develop preset to be modified and applied to an image. And second, develop presets cannot store crop settings.
There are a couple of threads in the Lightroom Feature Request forum mentioning the inability of crop settings to be specified in a develop preset. No generally applicable workaround has been found.

Related

Where do i store images and how do i get them in codename one new gui

I don't know where to store images and how to get the images by their id and this new gui is good but there are no tutorials on how to use it.
The images are stored in the resource file (theme.res) which lets you use features such as multi-image (an image that adapts to DPI.
You can edit the resource file via CSS or the designer (depending on your configuration). Assuming you didn't enable CSS you can use the following toolbar option to add an images directly from the GUI builder.
Notice these 3 icons on the top right area:
When you hover over them you should see the following tooltips:
Add Image
Add Multi Image
Set Multi Image Import DPI
They all do what you expect. The last one shows you this dialog:
Here you can define the density to which you designed the image you're importing. That way it will be logically scaled to all the other densities so an image designed for a 600ppi device will look similar on a 300ppi device (ppi == Pixels Per Inch).
I agree the UX should be improved here so I added an RFE for fixing this in a future update.

How to add Cartoon Color and Cartoon B&W filter effect on Image in iPhone [duplicate]

Is there any filters available in ios to convert a image to cartoonistic image like exactly in the above picture?
For a much faster solution than ImageMagick, you could use the GPUImageToonFilter from my GPUImage framework:
It combines Sobel edge detection with posterization of the image to give a good cartoon-like feel. As implemented in this framework, it's fast enough to run on realtime video from the iPhone's camera, and is probably at least an order of magnitude faster than something similar in ImageMagick. My framework's also a little easier to integrate with an iOS project than ImageMagick.
If you want more of an abstract look to the image, the GPUImageKuwaharaFilter converts images into an oil painting style, as I show in this answer.
Try to use imagemagick for iOS http://www.imagemagick.org/download/iOS/
Of course you need some serval hours how to use imagemagick for iOS.
But then you should also look at: http://www.fmwconcepts.com/imagemagick/cartoon/index.php
and maybe also on:
http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=11140&start=0&st=0&sk=t&sd=a
This Core Image filter section in the iOS dev library, possibly combined with the script referenced by Jonas and a little luck, might get you where you're going. Not sure, having never used either of these technologies.

How to give sketch effect on image in iphone?

I am implementing an iPhone application, in which I have implemented the following functionalities:
Select photo
Capture photo
Now I want to give a sketch effect to that photo like this one.
How could I do this?
If I may once again recommend it, my open source GPUImage framework has a built in filter that does just this. The GPUImageSketchFilter uses Sobel edge detection to highlight edges in black on images or video, leading to the exact same effect as seen in that application:
The above image was drawn from this answer, where I describe how that filter works, as well as show a couple other filter examples.
In fact, the SimplePhotoFilter example application that comes with the framework does exactly what you describe (capture a photo, apply a sketch filter to it, and save it to the photo library), so I'd start there if you want to get this up and running quickly.
OpenCV can be used to give sketch effect on image in iphone.
Refer iphone-how-to-convert-a-photo-into-a-pencil-drawing link and get helped.
Core Image filters are probably the best way to go.
http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Reference/CoreImageFilterReference/.

Create iphone interface from psd

For every developer arrives the day to improve the user interface experience because apps are evalutated mainly from the ui carefulness.
So, i've took a look around the websites and I found some psd where to start to desing my apps.
My question is: How to transform a psd prototype to a well-working app?
I don't unserstand how a mockup can help a developer to build a ui...
Can someone make me some clear the situation?
Well, I'd be careful to make a distinction between the graphics an app uses and the actual User Interface. Certainly the graphics are part of the UI, but the UI is soooo much more than that. Depending on how it is done, photoshop mock ups can be simple graphics you can use for your interface to complexes 'scenes' describing how the app functions. In the latter case, the mock-up can be useful for UI design, in the former case it just gives you pretty images to use (which can certainly be useful).
But to more directly answer your question, most people take 'slices' (individual pieces) of the photoshop image and export them as .png images (or .jpg). If the .psd file doesn't already have the images 'sliced', look up 'photoshop image slicing' on Google. You can then import them into Xcode and use them as background images for the controls you want to use. Especially since iOS 5.0, images can be used for a lot of controls. Also, you'll probably want to make sure you make the image resizable with proper UIEdgeInsets. This will allow the image to resize without pixilation by setting an area that can be tiled within the image.

How to create iOS image buttons that scale well across multiple resolutions?

I've run into the issue of using a UIBarButtonItem with a custom color. Everything out on the 'net seems to indicate that the only way around this lack of official API support revolves around the use of images. This is all fine and dandy when developing for pre-iOS 4 devices, except when using the new iPhone 4. Creating an image for iPad and pre-iOS 4 devices is straightforward enough, but the images developed for those devices look absolutely horrid on iPhone 4. I suspect that this problem will be exacerbated further with the introduction of next generation devices.
Consider the example below. Notice how the default colored button is nice and smooth, but the iPhone 3GS image looks terrible. It does not seem very scalable (pun intended) to have to include multiple images for different resolution devices.
In the absence of an official API for changing the color of a UIBarButtonItem, what strategies are out there for creating images that scale well against differing resolution devices? This problem is hardly unique to UIBarButtonItems, how is the community adapting to other UI elements that are bitmapped? Is there a better solution for this particular case than using an image (such as using Quartz to draw it)?
If at all possible, please offer concrete code examples.
You can list any image as Image#2x.png along with Image.png and the system will select the appropriate image at runtime.
If you look at the source for Three20 you can see how they draw custom buttons and shapes that will scale well, regardless of resolution.
Give Opacity (for Mac) a try. Draw your button in it with vector elements and effects, and it'll spit out the necessary Quartz code to reproduce it, drawing natively in your iOS application. You get Retina (#2x) support automatically.
Been over a year since I posted this question, but ran into a use case where I wanted to be able to do this, so instead of having to draw or otherwise create the buttons, I decided to write an open source application to create them. This application uses private APIs to change the colors of the UIBarButtonItem objects and then uses a graphics context to save them to a determined location on your computer's file system. This way you can have pixel perfect UIBarButtonItem images to use in your UIToolbars.
The app creates both the standard and #2x resolution images.
UIBarButtonItem-Generator # GitHub
Any vector drawing app may work, but I would also consider povray, which allows you to create in a C-like scripting 3D language, then export any pixel size you choose.
http://povray.org
I have the same problem with navigation bar so solve as the following:
first i subclass my navigation bar
inside this class
- (void)drawRect:(CGRect)rect
{
UIImage *image=[UIImage imageNamed:#"MyImage.png"];
self.frame=CGRectMake(0, 0, image.size.width, image.size.height);
self.backgroundImage =image;
}
finally save the same image with different resolution With #2x at the end