We are designing and building a compact gamma camera using a semiconductor hybrid pixel detector, for Tc-99m 140-keV imaging of sentinel lymph nodes during radio-guided surgery. In order to perform preliminary evaluations on the spatial resolution attainable with different collimators, we used the Medipix1 readout chip, bump-bonded to a silicon pixel detector (300 mum thick, 64 x 64 pixels, 170 mum pixel pitch, 1% detection efficiency at 140 keV). In this work we tested its performance with a knife-edge 0.35 turn pinhole collimator. Imaging results obtained with a 122 keV Co-57 gamma source show an on-axis system spatial resolution of 0.8 mm (resp. 1.8 mm) at 10 mm (resp. 40 mm) from the collimator face. The collimator efficiency was 2 x 10(-4) at 10 mm, reducing to 3 x 10(-5) at 40 mm from the collimator face. This gamma imaging system is compact, can be made hand-held and provides live-time imaging. It will have an acceptable detection efficiency when the Medipix2 chip will be available, in the next future, bonded to a CdTe pixel detector. (C) 2003 Elsevier Science B.V. All rights reserved.