How to place raster images as smart objects?

I'm trying to duplicate Photoshop's File:Place menu functionality and I'm experiencing something that I can't figure out. (I've added my code to the end of this message.)
I have a variety of test EPS images that I can run through the File:Place menu. They all appear on the document as "Smart Objects". That is I can then do a bunch of transforms to the image (like rotate, move, deform) before committing to the image to the document.
The important point here is that some images, when opened by Photoshop, first ask that I "Rasterize EPS Format" while others just open up without comment.
While doing these File:Place actions, I've been using the Listener plugin that comes with the SDK to generate code dumps of my actions. From these I've then generated my own code for placing images onto a document. I've had to re-arrange the code a bit to work in Objective-C so there's a good chance that I've done something wrong while translating.
Now if you look at my code you notice a commented out section. If you uncomment those lines then you basically have what I got from the Listener plugin log. But the problem is that this code then doesn't act like the File:Place menu action. It creates a new layer, places the image on the page - but its gone one step too far and the image is no longer a "Smart Object". The image is committed to the layer.
With a bit of experimenting I commented out the line that you can see commented out in my code. However, this does something odd. For all images you can see Photoshop put up a busy icon for a few seconds showing that it is process, but only images that Photoshop wants to "Rasterize EPS Format" actually appear on the page as Smart Objects. Trying to place the images that Photoshop doesn't rasterize results in nothing appearing.
That's my problem. If I uncomment that line in my code then all images that I test with appear on the page - but not as Smart Objects. If I comment out the code then only images that Photoshop wants to rasterize appear - but those that do appear then appear as Smart Objects.
So that's my goal: to place any image onto a document as a Smart Object just like Photoshop's File:Place menu command does. Any ideas where I'm going wrong?
- (SPErr)photoshopPlayeventPlace:(char *)cPath
PIActionDescriptor result = NULL;
Auto_Desc descriptor;
Auto_Desc offsetDetails;
SPErr error = kSPNoError;
Handle aliasValue = NULL;
FullPathToAlias(cPath, aliasValue);
do
error = sPSActionDescriptor->PutAlias(descriptor.get(), keyNull, aliasValue);
if (error) break;
// error = sPSActionDescriptor->PutEnumerated(descriptor.get(), keyFreeTransformCenterState, typeQuadCenterState, enumQCSAverage);
// if (error) break;
error = sPSActionDescriptor->PutUnitFloat(offsetDetails.get(), keyHorizontal, unitDistance, 0);
if (error) break;
error = sPSActionDescriptor->PutUnitFloat(offsetDetails.get(), keyVertical, unitDistance, 0);
if (error) break;
error = sPSActionDescriptor->PutObject(descriptor.get(), keyOffset, classOffset, offsetDetails.get());
if (error) break;
error = sPSActionControl->Play(&result, eventPlace, descriptor.get(), plugInDialogSilent);
if (error) break;
while (false);
if (result != NULL) sPSActionDescriptor->Free(result);
if (aliasValue != NULL) sPSHandle->Dispose(aliasValue);
return error;

If you want to go with Batch I would recommend creating an Action of more or less these steps:
• set the resolution to the same as the background image’s
• change the image from Background Layer to regular Layer if necessary
• convert it to a Smart Object
• add a Drop Shadow Layer Style to the image (do not use Global Angle)
• place the background image (File > Place …)
• move it behind the image layer
• Image > Reveal All
• make Selection from that layer’s transparency (cmd-click its icon in the Layers Panel) and use Image > Crop
• select and transform the image layer to fit the intended position
This would naturally work out best if the images had the same size and proportions.
For the reflection on the floor duplicate the image, flip it vertically, move it in position and reduce its opacity to maybe 10%.
Realistically you may have to hide it partially behind the pillows, a Vector Mask would be an option.

Similar Messages

  • Importing images as smart objects?

    When importing new images into cs5, which become Smart Objects and which do not?

    mediafred, have you checked out the effect of Preferences – General – Options – Place or Drag Raster Images As Smart Objects?

  • How to place an image in database and how to retrieve and display it in the front end

    how to place an image in database and how to retrieve and display it in the front end
    and to place an image in database and retrieve the image from database using xml
    please,help me out.

    Create a table with a Long RAW Datatype column for storing the Image Column Data.
    Create the form based on the table , which by defaults the column with LONG RAW atatype to a Image Item.
    You can use Forms Built in function READ_IMAGE_FILE to read a Image file stored on the file system in to the image item.
    A save on the form saves the image in the Image item in the long raw column.

  • How to place the images in Indesign xml file by Javascript?

    How to place the images in Indesign xml file by Javascript?
    We got the Indesign xml file, how to give the image placement link by Indesign javascript? Please help me its urgent.

    Hi,
    You can pass the image url as a href attribute=> file:///Users/me/Documents/my_pic.jpg directly within your xml. It just needs that you pass a local, static and valid url.
    If you want to add image later once the xml is flowed and so target specific nodes and inject images, it's a bit more complex. If the node is not part of the layout, you may try to reach the XMLElement objet and such an attribute, then layout the element.
    var x = some XMLElement
    x.xmlAttributes.add("href","file:///Users/m/Documents/my_pic.jpg" );
    If already placed, then you have to get the associated pageItem, then place your file into it.
    pagItm.place ( File ( "/Users/m/Documents/my_pic.jpg" ) );
    Hope that helps,
    Loic
    http://www.loicaigon.com

  • How to place multiple images?

    Hi,
    How to place multiple images?
    Regards,
    Learner

    Is the script creating the frames? If so, just assign each frame a
    variable, or make them all into an array. Then use something like:
    myFrame.place("aFile");
    If the script is not creating the frame, then are they live frames on
    the page, or are they actually on a master page?
    If they're on master spreads, you'll have to release them to the page
    you want. (I think it's myMasterFrame.override(myPage) where myPage is
    the live page you want to detach them on, but you'll have to double
    check that.)
    But presuming they're regular detached frames on a page, if you want
    your script to figure out which is the first and which is the second you
    can either use script labels in the UI and then search for the script
    label, or else you'll have to write a function that will get all
    rectangles on the page (myPage.rectangles.everyItem().getElements() and
    either do a clever javascript sort, or write a straightforward function
    to sort them by height and x-pos.
    Hope that sheds some light on the task ahead!
    Ariel

  • How to place an image in JFrame

    hello
    i want to know how to place a image on JFrame
    i am not using any layout..
    pls help..

    Hi...
    To do this, u can look to tweak the paintComponent() method . All u have to do is create a JPanel subclass and override the paintComponent method to draw the image. then set it as the frame's content pane. that is because you work only on the content pane in swing. that should help.
    Source for ImagePanel :
    <code>
    package com.rsramanujam.help;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.image.*;
    public class ImagePanel extends JPanel
         Image backImage = null;
         public ImagePanel(Image backImage)
              try
                   this.backImage = backImage;
              catch(Exception e)
                   System.out.println("Could not get Image");
         public void paintComponent(Graphics g)
              Graphics innerG = g.create();
              if(backImage == null)
                   innerG.setColor(new Color(0xffccccff));
                   innerG.fill3DRect(0,0,getSize().width,getSize().height,true);
              else
                   innerG.drawImage(backImage,0,0,getSize().width,getSize().height,this);
         public void setBackImage(String path)
              ImageIcon ic = new ImageIcon(path);
              this.backImage = ic.getImage();
              repaint();
    </code>
    U can see a working example at http://www.geocities.com/ramanujam_off/java.
    There , download the app called RamHelp. It comes with a GUI that uses panels with Background Images.
    Regards,
    Ramanujam

  • How to place a image in a page?

    pls anyone guide me? how to place a image in a page?
    thanks,
    screen410099

    Take a look at the code found in this function:
    SDKLayoutHelper::PlaceFileInFrame
    As expected you can find it in the SDKLayoutHelper file usually found in the Common folder of the SDK.  Anyway it has an example of one way of achieving your goal.
    There are other ways as well.  Here is some code from one of my plugins which uses the LoadPlaceGunCmd boss:
              PMRect pRC = itemGeometry -> GetPathBoundingBox(InnerToPasteboardMatrix(pParentTransform));;
              // Create an ImportCmd:
              InterfacePtr<ICommand> importAndLoadPlaceGunCmd(CmdUtils::CreateCommand(kImportAndLoadPlaceGunCmdBoss));
              //InterfacePtr<ICommand> importAndLoadPlaceGunCmd(CmdUtils::CreateCommand(kImportFileCmdBoss));
              if (importAndLoadPlaceGunCmd == nil)
                  ASSERT_FAIL("importAndLoadPlaceGunCmd invalid");
                  break;
                URI URIPath;
                URIUTILS -> IDFileToURI(path, URIPath);
              // Set the IImportResourceCmdData Interface's data:
              InterfacePtr<IImportResourceCmdData> importFileCmdData(importAndLoadPlaceGunCmd, IID_IIMPORTRESOURCECMDDATA);
              if (importFileCmdData == nil)
                  ASSERT_FAIL("importFileCmdData invalid");
                  break;
              importFileCmdData -> Set(db, URIPath, (K2::UIFlags)0, kTrue, kFalse);
              ErrorCode status = CmdUtils::ProcessCommand(importAndLoadPlaceGunCmd);
              const UIDList* imageList = importAndLoadPlaceGunCmd -> GetItemList();
              if (!imageList || imageList -> Length() == 0)
                  break;
              UIDRef imageFrame = imageList -> GetRef(0);
              InterfacePtr<IHierarchy> imageFrameHierarchy(imageFrame, UseDefaultIID());
              UIDRef newImage(db, imageFrameHierarchy -> GetChildUID(0));
              imageFrameHierarchy -> Remove(imageFrameHierarchy -> GetChildUID(0));
              // Create an placeGraphicCmd:
              InterfacePtr<ICommand> placeGraphicCmd(CmdUtils::CreateCommand(kPlaceItemInGraphicFrameCmdBoss));
              if (placeGraphicCmd == nil)
                  ASSERT_FAIL("placeGraphicCmd invalid");
                  break;
              placeGraphicCmd -> SetItemList(UIDList(newImage));
              // Set the IPlacePIData Interface's data:
              InterfacePtr<IPlacePIData> placePIData(placeGraphicCmd, IID_IPLACEPIDATA);
              if (placePIData == nil)
                  ASSERT_FAIL("placePIData invalid");
                  break;
              placePIData -> Set(pageItemRef, nil, kFalse);
              // Process the ImportAndPlaceCmd:
              status = CmdUtils::ProcessCommand(placeGraphicCmd);
    HTH.
    John

  • How to place multiple images in batch with drop shadow effects on room backgrounds at the same position?

    I want to place multiple images of hand paintings with drop shadow effects on room backgrounds to make them look as if the paintings are hanged on the room walls. I know how to do it one by one, but that takes time and I want to do it in batch at once.
    I am quite a beginner for adobe photoshop CS6. I belive such an automated task is possible through 'Automated Batch' function and/or 'Create Droplet' function. Kindly share your expert opinion.

    If you want to go with Batch I would recommend creating an Action of more or less these steps:
    • set the resolution to the same as the background image’s
    • change the image from Background Layer to regular Layer if necessary
    • convert it to a Smart Object
    • add a Drop Shadow Layer Style to the image (do not use Global Angle)
    • place the background image (File > Place …)
    • move it behind the image layer
    • Image > Reveal All
    • make Selection from that layer’s transparency (cmd-click its icon in the Layers Panel) and use Image > Crop
    • select and transform the image layer to fit the intended position
    This would naturally work out best if the images had the same size and proportions.
    For the reflection on the floor duplicate the image, flip it vertically, move it in position and reduce its opacity to maybe 10%.
    Realistically you may have to hide it partially behind the pillows, a Vector Mask would be an option.

  • How to place multiple images of hand paintings with drop shadow effects on room backgrounds?

    I want to place multiple images of hand paintings with drop shadow effects on room backgrounds to make them look as if the paintings are hanged on the room walls. I know how to do it one by one, but that takes time and I want to do it in batch at once.
    I am quite a beginner for adobe photoshop CS6. I belive such an automated task is possible through 'Automated Batch' function and/or 'Create Droplet' function. Kindly share your expert opinion.

    If you want to go with Batch I would recommend creating an Action of more or less these steps:
    • set the resolution to the same as the background image’s
    • change the image from Background Layer to regular Layer if necessary
    • convert it to a Smart Object
    • add a Drop Shadow Layer Style to the image (do not use Global Angle)
    • place the background image (File > Place …)
    • move it behind the image layer
    • Image > Reveal All
    • make Selection from that layer’s transparency (cmd-click its icon in the Layers Panel) and use Image > Crop
    • select and transform the image layer to fit the intended position
    This would naturally work out best if the images had the same size and proportions.
    For the reflection on the floor duplicate the image, flip it vertically, move it in position and reduce its opacity to maybe 10%.
    Realistically you may have to hide it partially behind the pillows, a Vector Mask would be an option.

  • Refresh underlying image of smart object

    Hello,
    I made some basic adjustments in Lightroom and then opened the image as a smart object in Photoshop.
    If I decide to make more changes in Lightroom how do I tell Photoshop to 'refresh' the underlying image?
    Thanks,
    Will

    wjl11 wrote:
    Since the underlying file is a dng, when I 'replace contents' in photoshop, ACR pops up.
    I never used ACR to adjust the file, I used Lightroom.
    Do I just assume that the ACR settings are what I applied to the file in Lightroom?
    LR and ACR store settings for the Adobe Conversion Engine in vasious places File MetaData, Sidecar files and ACR database to name some. If an embedded smart object is a RAW file the smart object has it set of Raw conversion setting.  You can in Photoshop use menu Layers>Smart Objects>New Smart Object via Copy to create a independent new smart object layer. Once this is done in Photoshop if you double click on the copied layer leyer's smart object icon in the layers palette ACR will open on the new copy with its copied RAW Conversion settings. You can  change the setting an have ACR update the copy's RAW settings.  You will not have two different RAW conversions in Photoshop on layers you can blend together to bring out more detail. With Smart Objects you dealing with copies...

  • How to Turn Off "Open As Smart Object" ??

    Help ! I am using PS CS3. I opened a JPG file as Camera Raw using "Open As Smart Object" just to see what it was all about. Now, when I use just "Open As" to open a JPG as Camera Raw, at the bottom of the CR dialogue, instead of "Open Image" it continues to say "Open Smart Object" even though I did not specify that I wanted to Open As Smart Object. How do I get back to just Open Image in the CR dialog. I have the latest version - is it me or it a bug ???

    Links do not seem to have a high discoverability in a software.
    A drop down list would not take much more screen real estate, I wonder why they got scrapped in favor of hyperlinks.

  • How to use data sets with smart objects?

    Hi,
    I have a psd of some mock-up boxes, and I want to apply different text to multiple versions. The solution here: http://helpx.adobe.com/photoshop/using/creating-data-driven-graphics.html is good, but doesn't seem to work with smart objects?
    The file that I have has the box label as a smart object (which opens as a psb). How could I apply a data set to that, and have it pump out multiple jpegs?
    If I apply the data set to the psb layers, then go back to the main image, I cannot export the whole complete picture anymore.
    Thanks!

    What database and connection type are you using? Are you connecting the report directly to the database, or trying to assign the datasource to object data?
    It sounds like you might be trying to use a linked list, collection or other C# construct to pass your data in. This currently isn't supported by the Crystal Reports SDK. You can use a DataSet or a DataTable, and possibly also an IDataReader depending on which version of Crystal Reports you're referencing in your project. Of course you can also connect directly to the database, even if the database isn't on the same machine as the application.
    The way to show master records with detail information is through the use of subreports and linked subreport parameters. Linked subreports take their parameter value from a record in the main report, so that only the data appropriate to that master record is displayed. The guys over in the [report design|SAP Crystal Reports; forum can help you out with this if you have questions on the specifics.

  • How do you replace a text smart object?

    I learned how here how to replace a photo with a similar photo in the same designs using the miracle of smart objects.
    But what about text?
    Let's say you have a chuck of text in a design and you want to change out that text with new text.
    Same principle?
    Only thing, unlike a photo -- text are not files to choose to replace with.

    SORRY, bit lost with both those answers.
    Here is where I am:
    With photos in layers, I convert to a smart object. Then I right click and do the replace, a new box comes up and I select a jpeg off the desktop.
    Again,
    with text, is there a corresponding function here or not?  You cannot choose a word file, right as your text replacement.
    Maybe I should just then add text the old fashioned way by dragging out a new text box for each new file in this series.
    I just thought it would be nice to replicate the smart object ease that I'm doing with images with text.
    Wade-- don't understand opening up a smart object with text -- I get digaloge box
    P -- your warp thing is way to convoluted for me sorry.

  • How to place an image onto each page

    Hi !
    How do I place an image onto each page (like a logo in a sidebar) using Pages 5.5 ?
    Thanks,
    Karsten

    Karsten,
    I am surprised no one has answered you yet - there are so many Pages users here.
    I am not a Pages user but I did find one way here on this thread in an answer from Arno Jannarelly
    insert image to header in Pages, template header
    "If you want any layout item to be repeated to all of the pages of your document, you just have to select the item(s), then go to Arrange/Section Masters/Move Object to Section Master.
    The good thing of this is that you can repeat any item or group of items placed anywhere you want on the page."
    Now when I first tried it I had no luck, until I selected the image and went to Arrange > Section Masters from the main menu, not on the right hand side from the Format/Document area.  
    From there there is an option: Move Object to Section Master.
    You then can format your image with drop shadows, opacity, etc. and it should be there on new pages in Pages. 

  • File Place, but not as Smart Object?

    Can you File>Place and Image without it being a Smart Object layer?

    Leaving as Smart Object is usually the way to go, but if for some reason you don't want a Smart Object you can always use: Layer: Rasterize: Smart Object.
    One problem with vector smart objects is the vector data is not present in Photoshop output. Meaning if a document has vector smart objects and you save as PDF, the SO ends up as pixels in the PDF output (check by opening the PDF with Acrobat and zoom in)
    You do have the option of copying vector data, then pasting as paths or shape layers. This is wrought with complications but it can yield vector output.

Maybe you are looking for

  • I cant restore from time machine after mountain lion update

    i recentlz went to Apple Geius to get my HD formatted as i had a corrupt disk. Once cleaned and my hardware all verified as OK, i got the apple store to load Mountain Lion, previously running Snow Leopard. I came home conneted to my time machine and

  • Not all my PowerPoint slides import into Captivate 3

    I am trying to import a 62-slide presentation in PowerPoint 2003 to Captivate 3, but only 10 slides will import. I am not sure what is causing the other 52 slides to not be recognized. Any suggestions? Thanks! Jennifer

  • IPhone 3G screen problem? Potentially?

    I dont know if this is an issue or not, but I've just noticed this. My iPhone's screen appears to have a border runnign around it of two or three blank pixels. It runs right the way around the edge of the screen. The main image the screen projects sh

  • Withlding tax invoice is not creating

    HELLO withholding tax invoice is not generating at the time of payment but it is calculating only. Steps Create standard invoice Rs 100 Attach payment withlding tax on line 6% Validate and approve Crate payment with Rs 94(deduct Rs 6%) Check withldin

  • How can i use numeric counter on a graph

    Hey guys,i need some help. I have 113 inputs and want to put a numeric counter to choose which input i want to see on graph. Can i do it?! Thank you all!!