Exhibit 10.4


    Exhibit
      10.4


     

    

      AMENDMENT
        NO. 1 TO PATENT AND TRADEMARK SECURITY AGREEMENT

      


      THIS
        AMENDMENT NO. 1 TO PATENT AND TRADEMARK SECURITY AGREEMENT,
        dated as
        of July 23, 2007 (this “Agreement”), by and between EMAGIN
        CORPORATION,
        a
        Delaware corporation (the “Grantor”), to ALEXANDRA
        GLOBAL MASTER FUND LTD.,
        a
        British Virgin Islands international business company, as collateral agent
        (in
        such capacity, the “Collateral Agent”) on behalf of the Holders (such
        capitalized term and all other capitalized terms used herein having the
        respective meanings provided herein), amends the PATENT
        AND TRADEMARK SECURITY AGREEMENT,
        dated
        as of July 21, 2006 (the “Patent and Trademark Security Agreement”), made
        by the
        Grantor to the Collateral Agent.

      


      W I T N E S S E T H:

      


      WHEREAS,
        the
        Grantor and the Collateral Agent are parties to the Patent and Trademark
        Security Agreement;

      


      WHEREAS,
        the
        Grantor and the Collateral Agent wish to amend the Patent and Trademark Security
        Agreement as provided in this Agreement; and

      


      NOW
        THEREFORE, in
        consideration of the premises and the mutual covenants made herein and for
        other
        good and valuable consideration, the receipt and sufficiency of which are
        hereby
        acknowledged, the parties hereto agree as follows:

      


      1. Definitions. 

      


      1.1 As
        used
        in this Agreement, the terms “Agreement”, “Grantor”, “Collateral Agent” and
“Patent and Trademark Security Agreement” shall have the respective meanings
        assigned to such terms in the introductory paragraph of this
        Agreement.

      


      1.2 Capitalized
        terms used in this Agreement and not defined in this Agreement shall have
        the
        respective meanings provided in the Patent and Trademark Security
        Agreement.

      


      1.3 All
        the
        agreements or instruments herein defined shall mean such agreements or
        instruments as the same may from time to time be supplemented or amended
        or the
        terms thereof waived or modified to the extent permitted by, and in accordance
        with, the terms thereof and of this Agreement.

      


      1.4 The
        following terms shall have the following meanings (such meanings to be equally
        applicable to both the singular and plural forms of the terms
        defined):

      


      “Amended
        Lockbox Agreement” means the Lockbox Agreement, dated as of July 21, 2006, by
        and between the Grantor, the Lockbox Agent and the Collateral Agent, as amended
        by Amendment No. 1 to Lockbox Agreement, dated as of July 23, 2007, by and
        between the Grantor and the Collateral Agent.

      


      
        
          
          

        

        
          
          

          
            

          

        

        
          
          

        

      

      “Amended
        Notes” means the Amended and Restated 8% Senior Secured Convertible Notes due
        2008 issued by the Grantor upon amendment and restatement of the
        Notes.

      


      “Amended
        Patent and Trademark Security Agreement” means the Patent and Trademark Security
        Agreement as amended by this Agreement.

      


      “Amended
        Pledge and Security Agreement” means the Pledge and Security Agreement, dated as
        of July 21, 2006, by and between the Grantor and the Collateral Agent, as
        amended by Amendment No. 1 to the Pledge and Security Agreement, dated as
        of
        July 23, 2007 by and between the Grantor and the Collateral Agent.

      


      “Amendment
        Agreements” means the several Amendment Agreements, dated as of July 23, 2007 by
        and between the Company and the Holders. 

      


      “Amendment
        Transaction Documents” means the Amended Notes, the Amended Warrants, the
        Certificate Designations, the Amended Patent and Trademark Security Agreement,
        the Amended Pledge and Security Agreement, the Amended Lockbox
        Agreement and
        the
        other agreements, instruments and documents contemplated hereby and
        thereby.

      


      “Certificate
        of Designations” means the Certificate of Designations of Series A Senior
        Secured Convertible Preferred Stock of the Grantor as filed with the Secretary
        of State of the State of Delaware.

      


      “Effective
        Date” shall have the meaning provided in Section 4.

      


      “Effective
        Time” shall have the meaning provided in the Amendment Agreements.

      


      “Holders”
        means with respect to any time prior to the Effective Time on the Effective
        Date
        the holders of Notes and with respect to any time after the Effective Time
        on
        the Effective Date, the holders from time to time of any Amended Notes or
        shares
        of Series A Preferred Stock.

      


      “Series
        A
        Preferred Stock” means the Series A Senior Secured Convertible Preferred Stock,
        par value $0.001 per share, of the Grantor.

      


      2. Amendments.

       

      2.1 Amendments
        to Patent and Trademark Security Agreement. Upon
        the
        terms and subject to the conditions of this Agreement, the Patent and Trademark
        Security Agreement is hereby amended as follows:

      


      (a) Amendment
        of Certain Definitions.
        Section
        1(d) of the Patent and Trademark Security Agreement shall be amended by deleting
        the terms “Additional Note Purchase Agreement”, “Event of Default”, “Holder”,
“Note Purchase Agreements”, “Majority Holders”, “Notes”, “Obligations” and
“Transaction Documents” and the accompanying definitions thereof and
        substituting in lieu thereof in their respective alphabetical order the
        following:

      


      
        
          
          

        

        
          
          

          
            

          

        

        
          
          

        

      

      “Additional
        Note Purchase Agreement” means the Note Purchase Agreement, dated as of July 21,
        2006, as amended on March 28, 2007, by and between the Company and Stillwater
        LLC, as amended by the Amendment Agreement, pursuant to which the Company
        issued
        the Additional Note.

      


      “Event
        of
        Default” means:

      


      (1) the
        failure by the Grantor to perform in any material respect any obligation
        of the
        Grantor under this Agreement as and when required by this Agreement;
        or

      


      (2) the
        failure by the Grantor to pay the Optional Redemption Price or the Mandatory
        Redemption Price; or

      


      (3) the
        breach by the Grantor of any other material covenant or other term or condition
        of the Certificate of Designations; or

      


      (4) any
        representation or warranty made by the Grantor pursuant to this Agreement
        shall
        have been untrue in any material respect when made or deemed to have been
        made;
        or

      


      (5) the
        failure by the Grantor to perform in any material respect any obligation
        of the
        Grantor under the Patent and Trademark Security Agreement as and when required
        by the Patent and Trademark Security Agreement;

      


      (6) any
        representation or warranty made by the Grantor pursuant to the Patent and
        Trademark Security Agreement shall have been untrue in any material respect
        when
        made or deemed to have been made;

      


      (7) the
        failure by the Grantor to perform in any material respect any obligation
        of the
        Grantor under the Lockbox Agreement as and when required by the Lockbox
        Agreement;

      


      (8) any
        representation or warranty made by the Grantor pursuant to the Lockbox Agreement
        shall have been untrue in any material respect when made or deemed to have
        been
        made; or

      


      (9) any
        Event
        of Default, as that term is defined in any of the Notes.

      


      “Holder”
        means any Buyer or any holder from time to time of any Note or any Preferred
        Shares.

      


      
        
          
          

        

        
          
          

          
            

          

        

        
          
          

        

      

      “Majority
        Holders” means at any time (i) such of the holders of Notes who hold Notes
        which, based on the outstanding principal amounts thereof, represent a majority
        of the aggregate outstanding principal amount of the Notes at such time,
        and
        (ii) such of the holders of Preferred Shares which shares constitute a majority
        of the outstanding Preferred Shares at such time.

      


      “Note
        Purchase Agreements” means the several Note Purchase Agreements, dated as of
        July 21, 2006, by and between the Grantor and the respective Buyer party
        thereto, as amended by the Amendment Agreement, pursuant to which the Grantor
        issued the Notes, including, without limitation, the Additional Note Purchase
        Agreement.

      


      “Notes”
        means the Amended and Restated 8% Senior Secured Convertible Notes due 2008
        issued by the Grantor upon amendment and restatement of the Grantor’s 6% Senior
        Secured Convertible Notes due 2007-2008, as amended, originally issued pursuant
        to the Note Purchase Agreements, including, without limitation, the Additional
        Note.

      


      “Obligations”
        means:

      


      (1) the
        full
        and prompt payment when due of all obligations and liabilities to the Holders,
        whether now existing or hereafter arising, under the Transaction Documents
        and
        the due performance and compliance with the terms of the Transaction
        Documents;

      


      (2) the
        full
        and prompt payment when due of all obligations and liabilities of the Grantor
        to
        pay the Optional Redemption Price and Mandatory Redemption Price pursuant
        to the
        Preferred Shares and the due performance and compliance with the terms of
        the
        Certificate of Designations;

      


      (3) any
        and
        all sums advanced by the Collateral Agent or any Holder in order to preserve
        the
        Collateral or to preserve the Security Interest;

      


      (4) in
        the
        event of any proceeding for the collection or enforcement of any obligations
        or
        liabilities of the Grantor referred to in the immediately preceding clauses
        (1)
        and (2) in accordance with the terms of the Transaction Documents, the
        reasonable expenses of re-taking, holding, preparing for sale, selling or
        otherwise disposing of or realizing on the Collateral, or of any other exercise
        by the Collateral Agent of its rights hereunder, together with reasonable
        attorneys' fees and court costs; and

      


      (5) any
        amounts for which the Collateral Agent or any Holder is entitled to
        indemnification under Section 4(n).

       

      (b) Additional
        Defined Terms. Section
        1(d) of the Patent and Trademark Security Agreement shall be amended by adding
        new defined terms and definitions thereof, in the places constituting their
        respective alphabetical orders, as follows:

      


      
        
          
          

        

        
          
          

          
            

          

        

        
          
          

        

      

      “Amendment
        Agreement” means the several Amendment Agreements, dated as of July 23, 2007, by
        and between the Grantor and the Holders.

      


      “Certificate
        of Designations” means the Certificate of Designations of Series A Senior
        Secured Convertible Preferred Stock of the Grantor as filed with the Secretary
        of State of the State of Delaware.

      


      “Mandatory
        Redemption Price” shall have the meaning assigned to such term in the
        Certificate of Designations.

      


      “Optional
        Redemption Price” shall have the meaning assigned to such term in the
        Certificate of Designations.

      


      “Preferred
        Shares” means shares of Series A Senior Secured Convertible Preferred Stock
        issued by the Grantor.

      


      3. Effect
        of Amendment; Confirmation.

      


      (a) From
        and
        after the Effective Date, the rights and obligations of the Grantor, the
        Collateral Agent and the Holders under the Patent and Trademark Security
        Agreement and the Transaction Documents and all other agreements, documents
        and
        instruments contemplated hereby and thereby shall apply with full force and
        effect to the Patent and Trademark Security Agreement, as amended by this
        Agreement, and each reference to the Patent and Trademark Security Agreement
        in
        the Transaction Documents shall be deemed to be a reference to the Patent
        and
        Trademark Security Agreement, as amended by this Agreement and each reference
        in
        the Patent and Trademark Security Agreement to “this Agreement,” “hereunder,”
“hereof,” “herein,” or words of like import shall mean and be a reference to the
        Patent and Trademark Security Agreement as amended hereby, and this Agreement
        and the Patent and Trademark Security Agreement shall be read together and
        construed as a single instrument.

      


      (b) Except
        as
        amended by this Agreement, the Patent and Trademark Security Agreement shall
        remain in full force and effect in accordance with its respective
        terms.

      


      (c) The
        execution, delivery and effectiveness of this Agreement shall not, except
        as
        expressly provided herein, operate as a waiver of any right, power or remedy
        of
        the Collateral Agent, the Grantor or the Holders under the Patent and Trademark
        Security Agreement or any of the Transaction Documents, nor constitute a
        waiver
        or amendment of any other provision of the Patent and Trademark Security
        Agreement or any of the Transaction Documents or for any purpose except as
        expressly set forth herein.

      


      (d) Nothing
        in this Agreement or in connection with the transactions contemplated by
        this
        Agreement or otherwise shall be construed, directly or indirectly, by
        implication or otherwise to impair the validity, enforceability, priority,
        perfection or other attributes of the security interest granted pursuant
        to the
        Patent and Trademark Security Agreement.

      


      
        
          
          

        

        
          
          

          
            

          

        

        
          
          

        

      

      4. Effectiveness.

      


      The
        amendment of the Patent and Trademark Security Agreement pursuant to this
        Agreement shall become effective on the date (the “Effective Date”) when all of
        the following conditions are satisfied:

      


      (a) The
        Collateral Agent shall have received Acknowledgement and Consents, in the
        form
        attached hereto as Exhibit
        A,
        from
        the Majority Holders; and

      


      (b) On
        the
        Effective Date the Effective Time under all of the Amendment Agreements shall
        have occurred.

      


      5. Miscellaneous. 

      


      5.1 Waiver
        and Amendments; Successors and Assigns.

      The
        provisions of Section 13 of the Patent and Trademark Security Agreement shall
        be
        applicable to this Agreement as if this Agreement were the “Agreement” referred
        to in Section 13 of the Patent and Trademark Security Agreement.

      


      5.2 Counterparts.

      This
        Agreement may be executed in two or more counterparts, each of which shall
        be
        deemed an original, but all of which together shall constitute one and the
        same
        instrument.

      


      5.3 Titles
        and Subtitles.

      The
        titles and subtitles used in this Agreement are used for convenience only
        and
        are not to be considered in construing or interpreting this
        Agreement.

      


      5.4 Notices.

      Any
        notice required or permitted under this Agreement shall be given as provided
        in
        the Patent and Trademark Security Agreement.

      


      5.5 Severability.

      If
        one or
        more provisions of this Agreement are held to be unenforceable under applicable
        law, such provision shall be excluded from this Agreement and the balance
        of
        this Agreement shall be interpreted as if such provision were so excluded
        and
        shall be enforceable in accordance with its terms.

      


      5.6 Entire
        Agreement.

      This
        Agreement and the other Amendment Transaction Documents and other documents
        contemplated hereby and thereby constitute the entire agreement among the
        parties hereof with respect to the subject matter hereof and thereof and
        supersede all prior agreements and understandings, both oral and written,
        between the parties with respect to the subject matter hereof and
        thereof.

      


      5.7 Further
        Assurances.

      The
        parties shall execute and deliver all such further instruments and documents
        and
        take all such other actions as may reasonably be required to carry out the
        transactions contemplated hereby and to evidence the fulfillment of the
        agreements herein contained.

      


      
        
          
          

        

        
          
          

          
            

          

        

        
          
          

        

      

      5.8 Applicable
        Law.

      This
        Agreement shall be governed by, and construed in accordance with, the laws
        of
        the State of New York without regard to principles of conflicts of laws,
        except
        to the extent that under the New York Uniform Commercial Code the laws of
        another jurisdiction govern matters of perfection and the effect of perfection
        or non-perfection of any security interest granted under the Patent and
        Trademark Security Agreement, as amended by this Agreement.

      


      5.9 Counterparts;
        Execution.

      This
        Agreement may be executed in any number of counterparts and by the parties
        hereto on separate counterparts, but all the counterparts taken together
        shall
        be deemed to constitute one and the same instrument. This Agreement, once
        executed by a party, may be delivered to the other party hereto by electronic
        or
        telephone line facsimile transmission of a copy of this Agreement bearing
        the
        signature of the party so delivering this Agreement.

      


      5.10 Construction.

      The
        language used in this Agreement will be deemed to be the language chosen
        by the
        parties to express their mutual intent, and no rules of strict construction
        will
        be applied against any party.

      


      [Signature
        Pages Follow]


      
        
           

          
          

        

        
          
          

          
            

          

        

        
          
          

        

      


      IN
        WITNESS WHEREOF,
        the
        Grantor and the Collateral Agent have caused this Agreement to be duly executed
        and delivered by their respective officers or other representatives thereunto
        duly authorized as of the date first above written.

       

       

      
        	 	 	 
	 	EMAGIN
                CORPORATION
	 
 	 
 	 
 
	 	By:  	/s/ 
	 	
                

                Name:
                  

                Title:
                  

              
	 	 


      

      
        	 	 	 
	 	
                ALEXANDRA GLOBAL MASTER FUND LTD.,
                  as Collateral
                  Agent

                 

                By: ALEXANDRA
                  INVESTMENT MANAGEMENT, LLC,
                  
                  as
                    Investment Advisor

                

              
	 
 	 
 	 
 
	
              	By:  	
                /s/ 

              
	 	
                
                  

                

                Name:
                  

                Title:
                  

              
	 	 


      

      
 

      
        
           

          
          

        

        
          
          

          
            

          

        

        
          
          

        

      


      EXHIBIT
        A

      


      ACKNOWLEDGEMENT
        AND CONSENT

      


      To:
        ALEXANDRA GLOBAL MASTER FUND LTD.,

      As
        Collateral Agent

       

      c/o
        Alexandra Investment Management, LLC

      767
        Third
        Avenue, 39th
        Floor

      New
        York,
        New York 10017

      


      Re:
        eMagin Corporation

      


      Reference
        is made to the Patent and Trademark Security Agreement, dated as of July
        21,
        2006 (as amended, supplemented or otherwise modified from time to time, the
        “Patent and Trademark Security Agreement”) by and between eMagin Corporation, a
        Delaware corporation (the “Grantor”), to Alexandra Global Master Fund Ltd., a
        British Virgin Islands international business company, as collateral agent
        (in
        such capacity, the “Collateral Agent”) on behalf of the Holders. Capitalized
        terms used herein and not otherwise defined herein are used herein as defined
        in
        the Patent and Trademark Security Agreement.

      


      The
        Grantor has requested that the Holders consent to an Amendment to the Patent
        and
        Trademark Security Agreement on the terms described in that certain Amendment
        No. 1 to the Patent and Trademark Security Agreement (“Amendment No. 1 to Patent
        and Trademark Security Agreement”), the form of which is attached
        hereto.

      


      Pursuant
        to Section 13 of the Patent and Trademark Security Agreement, the undersigned
        Holder hereby consents to the terms of Amendment No. 1 to Patent and Trademark
        Security Agreement and authorizes the Collateral Agent to execute and deliver
        Amendment No. 1 to Patent and Trademark Security Agreement on its
        behalf.

       

       

      
        	 	 	 
	 	
                Very
                  truly yours,

                


                NAME
                  OF HOLDER:

                ______________________________

              
	 
 	 
 	 
 
	Dated
                as
                of July 23, 2007	By:  	/s/ 
	 	
                
                  

                

                Name:

                Title: